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()?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is active unix domain sockets?

853


Where is the socket located?

847


How are unix domain sockets implemented?

794


How does unix socket work?

843


Why does the sockets buffer fill up sooner than expected?

1286


What pieces of information make up a socket?

906


What is socket address with example?

796


What are the pros/cons of select(), non-blocking I/O and SIGIO?

1312


What is a socket connection?

882


Can multiple clients connect to same socket?

849


How does a socket work?

824


Is tcp or unix socket faster?

792


What is socket address?

973


What's better 6pt or 12pt sockets?

776


How do I use TCP_NODELAY?

1499