Skip to content

Commit 72b2a99

Browse files
committed
Document MSG_TRUNC behavior in recv/recvfrom()
1 parent 1b61de4 commit 72b2a99

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎Doc/library/socket.rst‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,6 +1786,10 @@ Socket Objects
17861786
See the Unix manual page :manpage:`recv(2)` for the meaning of the optional argument
17871787
*flags*; it defaults to zero.
17881788

1789+
When the :data:`!socket.MSG_TRUNC` flag is used, only receive up to
1790+
*bufsize* bytes even if the C function :c:func:`!recv` returns more
1791+
bytes (the real datagram size).
1792+
17891793
.. versionchanged:: 3.5
17901794
If the system call is interrupted and the signal handler does not raise
17911795
an exception, the method now retries the system call instead of raising
@@ -1801,6 +1805,10 @@ Socket Objects
18011805
to zero. The format of *address* depends on the address family --- see
18021806
:ref:`socket-addresses`.
18031807

1808+
When the :data:`!socket.MSG_TRUNC` flag is used, only receive up to
1809+
*bufsize* bytes even if the C function :c:func:`!recvfrom` returns more
1810+
bytes (the real datagram size).
1811+
18041812
.. versionchanged:: 3.5
18051813
If the system call is interrupted and the signal handler does not raise
18061814
an exception, the method now retries the system call instead of raising

0 commit comments

Comments
 (0)