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 |
How often should I re-transmit un-acknowleged messages?
When will my application receive SIGPIPE?
How would I put my socket in non-blocking mode?
What is socket address with example?
Why do I get EPROTO from read()?
How can I read only one character at a time?
What exactly is a socket?
How do Sockets Work?
What does af mean in sockets?
How does a socket work?
What is the difference between SO_REUSEADDR and SO_REUSEPORT?
How many socket connections can a server handle?