Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between connected and unconnected sockets?



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

Post New Answer

More Unix Socket Programming Interview Questions

of the socket? Does doing a connect() call affect the receive behaviour?

1 Answers  


Why do I get connection refused when the server is not running?

1 Answers  


Why does the sockets buffer fill up sooner than expected?

0 Answers  


How does a socket work?

0 Answers  


How can I force a socket to send the data in its buffer?

0 Answers  


How can I listen on more than one port at a time?

1 Answers  


Explain the TIME_WAIT state.

1 Answers  


Can a socket have multiple ports?

0 Answers  


How can I be sure that UDP messages are received in order?

1 Answers  


Why do I keep getting EINTR from the socket calls?

1 Answers  


When should I use shutdown()?

1 Answers   Wipro,


How would I put my socket in non-blocking mode?

1 Answers  


Categories