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 difference between socket () and serversocket () class?
What is socket address with example?
What is sae socket?
What is socket address?
How do unix sockets work?
How does a socket work?
How are unix domain sockets implemented?
system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?
Why sockets are used?
What is a socket address?
What pieces of information make up a socket?
What is a socket api?
How do I convert a string into an internet address?
Whats the difference between select() and poll()?
Why do we need sockets?