Normal termination of the message exchange session will be completed via the exchange of Logout<5> messages. Termination by other means should be considered an abnormal condition and dealt with as an error. Session termination without receiving a Logout<5> should treat the counterparty as logged out.
It is recommended that before sending the Logout<5> message, a TestRequest<1> should be issued to force a Heartbeat<0> from the other side. This helps to ensure that there are no sequence number gaps.
Before actually closing the session, the logout initiator should wait for the opposite side to respond with a confirming Logout<5> message. This gives the remote end a chance to perform any Gap Fill operations that may be necessary. Once the messages from the ResendRequest<2> have been received, the acceptor should issue the Logout. The session may be terminated if the acceptor does not respond in an appropriate timeframe.
The logout initiator should not send any messages after the logout.
Note: Logging out does not affect the state of any orders. All active orders will continue to be eligible for execution after logout.