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...


When should I use shutdown()?



When should I use shutdown()?..

Answer / chaitanya

shutdown() is useful for deliniating when you are done providing a request to a server using TCP. A typical use is to send a request to a server followed by a shutdown(). The server will read your request followed by an EOF (read of 0 on most unix implementations). This tells the server that it has your full request. You then go read blocked on the socket. The server will process your request and send the necessary data back to you followed by a close. When you have finished reading all of the response to your request you will read an EOF thus signifying that you have the whole response. It should be noted the TTCP (TCP for Transactions -- see R. Steven's home page) provides for a better method of tcp transaction management.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix Socket Programming Interview Questions

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

1 Answers  


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

1 Answers  


Are unix sockets faster than tcp?

0 Answers  


Can multiple clients connect to same socket?

0 Answers  


How can I bind() to a port number < 1024?

1 Answers  


How should I choose a port number for my server?

1 Answers  


Explain the TIME_WAIT state.

1 Answers  


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

1 Answers  


Whats the difference between select() and poll()?

0 Answers  


Why do I get EPROTO from read()?

0 Answers  


How do I convert a string into an internet address?

0 Answers  


How are unix domain sockets implemented?

0 Answers  


Categories