Explain the TIME_WAIT state.

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


Please Help Members By Posting Answers For Below Questions

What's better 6pt or 12pt sockets?

476


What's the difference between a socket and a port?

454


What is af_inet in socket?

469


What is socket address with example?

487


What is difference between socket and websocket?

480






How many socket connections can a server handle?

465


system choose one for me on the connect() call? Should I bind() a port number in my client program, or let the?

1159


Are unix sockets faster than tcp?

492


How are unix domain sockets implemented?

490


What is sae socket?

433


How does unix socket work?

502


Can a socket have multiple ports?

501


How many sockets can a port have?

477


How many sockets can a cpu have?

493


Can a single socket port be used for multiple applications?

452