High performance IO on non-blocking sockets
Dave Brueck
dave at pythonapocrypha.com
Fri Mar 14 12:01:41 EST 2003
On Fri, 14 Mar 2003, Richie Hindle wrote:
>
> [Troels]
> > sent = self.socket.send(self.data)
> > self.data = self.data[sent:]
> >
> > This approach is bad [...]
>
> >From http://www.python.org/doc/current/lib/socket-objects.html :
>
> ------------------------------- snip snip -------------------------------
>
> 7.2.1 Socket Objects
>
> [...]
>
> sendall( string[, flags])
>
> Send data to the socket. The socket must be connected to a remote socket.
> The optional flags argument has the same meaning as for recv() above.
> Unlike send(), this method continues to send data from string until either
> all data has been sent or an error occurs. None is returned on success. On
> error, an exception is raised, and there is no way to determine how much
> data, if any, was successfully sent.
>
> ------------------------------- snip snip -------------------------------
Nope - the OP needs something for non-blocking sockets.
-Dave
More information about the Python-list
mailing list