What is the difference between connected and unconnected sockets?
Answer / 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 |
Can multiple sockets use the same port?
What is active unix domain sockets?
How can I bind() to a port number < 1024?
Are sockets files?
How can I find the full hostname (FQDN) of the system I am running on?
What pieces of information make up a socket?
When should I use shutdown()?
Can a socket have multiple ports?
What is the function of socket?
Whats the difference between select() and poll()?
How can my client work through a firewall/proxy server?
Can multiple clients connect to same socket?