Name

sendto

Synopsis

                        s.sendto(string,(host,port))

Sends the bytes of string on the socket to the destination host and port, and returns the number n of bytes sent. Useful with datagram-oriented sockets, which can send data to various destinations. You must not have previously called method s .bind. n may be lower than len( string ); your program must check, and resend the unsent substring string [ n :] if non-empty.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.