3.1.5.9 Closing a Session
A protocol session is closed by executing the following steps. The protocol does not send a packet to indicate session closure; instead, the underlying transport connection is simply closed.
If the initiator is closing the session and the OutgoingQueueReference.State is not OnHold:
The OutgoingQueueReference.State MUST be set to Disconnecting.
Close the underlying TCP or SPX transport connection.
Stop all timers.
The SessionState ADM element MUST be set to CLOSED.
If the initiator is closing a session and the OutgoingQueueReference.State is not OnHold:
The OutgoingQueueReference.State MUST be set to Disconnected.
If the OutgoingMessageTable ADM element is not empty, the protocol MUST start the Session Retry Connect Timer (section 3.1.2.3) and set the SessionState ADM element to WAITING_RECONNECT.