THARENOS@IBM.COM.UUCP (02/18/87)
> The question is, what is a TCP to do if it is in FIN-WAIT-2, it has some > user data that the user hasn't asked for yet, and a FIN comes in? If it > goes immediately to TIME-WAIT (as this TCP does) the user will receive an error > because RFC 793 says that a RECEIVE call while in TIME-WAIT returns "error: Thought I'd take a stab at this one .... The key here is that a FIN implies a PUSH. It is the responsibility of your TCP to asyncronously notify the client that a PUSH has arrived and that a RECEIVE is needed. If the client is well behaved, then a RECEIVE should be forthcoming. However, this is where your question gets tricky. Should TCP wait before entering the TIME-WAIT state for the client to respond with the receive? This adds a client condition to the state table of TCP. If the client was smarter, there would be multiple RECEIVEs queued and TCP could satisfy the FIN(push) immediately and thus enter TIME-WAIT without worry. If, however, your client decides to be a bad client and wait a few hours before issuing the RECEIVE, then your question comes to light. I would venture a guess that TCP should stay in FIN-WAIT-2 until the push signal has been satisfied with a RECEIVE and then enter TIME-WAIT. Mike Tharenos <Tharenos@ibm.COM> Networking Support and Development IBM, Almaden Research Center 408-927-2727