RFN2, RFN1 and CLZW States
State 14 - RFN2 - Final RFNM wait sub 2.
This state means that an unexpected close arrived when we were happily sending data. We now await the final RFNM for any outstanding data messages. When this occurs, or if there were no outstanding messages, the state moves to CLZW. ACLO is performed, sending a CLS (matching the unexpected CLS which arrived during OPND) and closing the link. If two minutes go by and no final RFNM arrives, we also just go to CLZW to prevent being hung by an unresponsive foreign host or an IMP/subnet failure, also performing ACLO. This is analogous to the timeout from state DATW above.
While waiting for the RFNM, the local program may try to CLOSF the connection (CLZR, CLZS). If so, we go to state RFN1 and continue to await the final RFNM.
State 12 - RFN1 - Final RFNM wait sub 1.
In this state, it's all over but the final RFNM. When it arrives (RRFN) or two minutes go by (TIME), we close the link tables and send a CLS to the foreign site (ACLO). Since the CLS has already been received, the connection is now gone and we step it to FREE.
State 13 - CLZW - Wait for program to close file.
This is the normal state after an end of file when receiving, before the CLOSF (CLZR) has occurred. It is also the state of a send connection which was aborted (CLS) by the receiver (foreign host) when all sent messages have been RFNM'ed but the local CLOSF (CLZS) has not been done. We wait for the local program to do the CLOSF. When it does, we close the link table if this is a receive connection, and in either case step the connection to the FREE state.