Explain the TIME_WAIT state.



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

Post New Answer

More Unix Socket Programming Interview Questions

Where can a get a library for programming sockets?

1 Answers  


How are unix domain sockets implemented?

0 Answers  


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 a socket file?

0 Answers  


Is there any advantage to handling the signal, rather than just ignoring it and checking for the EPIPE error? Are there any useful parameters passed to the signal catching function?

0 Answers  






What exactly does SO_LINGER do?

1 Answers  


What exactly does SO_KEEPALIVE do?

1 Answers  


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

0 Answers  


What are socket exceptions? What is out-of-band data?

1 Answers  


What is socket programming in java?

0 Answers  


What is the difference between a socket and a port?

0 Answers  


How do I properly close a socket?

1 Answers  


Categories