What is the difference between connected and unconnected sockets?
Answer Posted / chaitanya
If a UDP socket is unconnected, which is the normal state after a bind() call, then send() or write() are not allowed, since no destination address is available; only sendto() can be used to send data.
Calling connect() on the socket simply records the specified address and port number as being the desired communications partner. That means that send() or write() are now allowed; they use the destination address and port given on the connect call as the destination of the packet.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the function of socket?
What is socket address with example?
Are unix sockets faster than tcp?
What is a socket file?
What is a socket set used for?
What's better 6pt or 12pt sockets?
system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?
Is socket a hardware or software?
What is a socket address?
What is af_inet in socket?
Can a single socket port be used for multiple applications?
What is sae socket?
Can a socket have multiple ports?
What's the difference between a socket and a port?
Where is the socket located?