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
Why do we need sockets?
Why does it take so long to detect that the peer died?
What is a socket address?
What is the function of socket?
Why do we need socket programming?
How many sockets can a port have?
What are the types of sockets?
Is socket a hardware or software?
How can I tell when a socket is closed on the other end?
What is difference between socket and websocket?
How to find other end of unix socket connection?
What does af mean in sockets?
Can a single socket port be used for multiple applications?
What is the difference between a socket and a port?
How many sockets can a cpu have?