DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Developing applications over TCP/IP using Internet sockets

Using connect on a datagram socket (Internet domain)

Datagram sockets can also use connect to associate a socket with a specific address. Any data sent on the socket is automatically addressed to the connected peer, and only data received from that peer is delivered to the user.

Only one connected address is permitted for each socket (that is, no multicasting); a second connect will change the destination address, and a connect to a null address (family AF_UNSPEC) will disconnect. Connect requests on datagram sockets return immediately; the system merely records the peer's address, as compared to a stream socket where a connect request initiates establishment of an end to end connection. The accept and listen calls are not used with datagram sockets.

If connect is used with a datagram socket, read, write, send and recv can be used to transfer data.


Next topic: Input/output multiplexing (Internet domain)
Previous topic: Receiving on datagram sockets (Internet domain)

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003