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 |
What is difference between socket () and serversocket () class?
What is active unix domain sockets?
What's better 6pt or 12pt sockets?
What is the purpose of socket?
What is the difference between a socket and a port?
How can I tell when a socket is closed on the other end?
Are sockets files?
What is Mac, and how is it different from PC? Which one is better for professional users, and why
1 Answers Evolving Systems, IBM,
How can I write a multi-homed server?
After the chroot(), calls to socket() are failing. Why?
Can multiple sockets use the same port?
When should I use shutdown()?