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 Mac, and how is it different from PC? Which one is better for professional users, and why
1 Answers Evolving Systems, IBM,
What is socket address?
How can I write a multi-homed server?
Why do I keep getting EINTR from the socket calls?
How can I find the full hostname (FQDN) of the system I am running on?
How do I use TCP_NODELAY?
What's the difference between a socket and a port?
How can I read ICMP errors from connected UDP sockets?
When will my application receive SIGPIPE?
How to find other end of unix socket connection?
What is socket address with example?
When should I use UDP instead of TCP?