Victor Antonovich wrote:
I has analysed source code of the example and has discovered that if
TCP state machine goes into FIN_WAIT_2 state and FIN is never come in,
TCP layer hang up and only reset can restore full functionality. This
can happened in real internet application if connection with remote
side will be broken before last FIN was sent. I wrote small patch
which implements timeout in FIN_WAIT_2 state and prevents TCP layer
hanging. Matthias tested this patch and says that it can solve the
problem. The patch is attached to this message.
This has been a messy area in a number of TCP/IP stacks. The spec
doesn't call for a FINWAIT2 timeout, but if you don't have one things
won't tidy up when a client disconnects badly. In practice, any real
TCP/IP stck needs a FINWAIT2 timeout.
The patch looks reasonable, so I commited it to CVS.
Regards,
Steve