Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39368c1

Browse files
committed
Added documentation of the sendall() method, and a note to the send() method
that it does not guarantee that all data is sent. This closes SF patch #474307.
1 parent 6d30c3e commit 39368c1

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/lib/libsocket.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,19 @@ \subsection{Socket Objects \label{socket-objects}}
477477
Send data to the socket. The socket must be connected to a remote
478478
socket. The optional \var{flags} argument has the same meaning as for
479479
\method{recv()} above. Returns the number of bytes sent.
480+
Applications are responsible for checking that all data has been sent;
481+
if only some of the data was transmitted, the application needs to
482+
attempt delivery of the remaining data.
483+
\end{methoddesc}
484+
485+
\begin{methoddesc}[socket]{sendall}{string\optional{, flags}}
486+
Send data to the socket. The socket must be connected to a remote
487+
socket. The optional \var{flags} argument has the same meaning as for
488+
\method{recv()} above. Unlike \method{send()}, this method continues
489+
to send data from \var{string} until either all data has been sent or
490+
an error occurs. \code{None} is returned on success. On error, an
491+
exception is raised, and there is no way to determine how much data,
492+
if any, was successfully sent.
480493
\end{methoddesc}
481494

482495
\begin{methoddesc}[socket]{sendto}{string\optional{, flags}, address}

0 commit comments

Comments
 (0)