Explain the TIME_WAIT state.
Answer / chaitanya
Remember that TCP guarantees all data transmitted will be delivered, if at all possible. When you close a socket, the server goes into a TIME_WAIT state, just to be really really sure that all the data has gone through. When a socket is closed, both sides agree by sending messages to each other that they will send no more data. This, it seemed to me was good enough, and after the handshaking is done, the socket should be closed. The problem is two-fold. First, there is no way to be sure that the last ack was communicated successfully. Second, there may be "wandering duplicates" left on the net that must be dealt with if they are delivered.
| Is This Answer Correct ? | 1 Yes | 0 No |
What is the function of socket?
How do I properly close a socket?
Why does connect() succeed even before my server did an accept()?
How does a socket work?
Where can a get a library for programming sockets?
How many socket connections can a server handle?
How can I be sure that UDP messages are received in order?
How come I get address already in use from bind()?
What is the difference between read() and recv()?
How can I force a socket to send the data in its buffer?
What exactly is a socket?
How do I get the port number for a given service?