Connections are the primary unit of resource management. Sessions and Links are components of connections. When the Connection is freed/discarded, any resources associated with the Sessions and Links are automatically destroyed or discarded as well.
Each of the Connection, Session, and Link endpoints share a common state model. Note that although this follows the same pattern as the protocol state model for open/close, begin/end, and attach/detach, this does not necessarily correspond one to one to the protocol state model for endpoints. For example the engine implementation may detach/reattach a link endpoint without visibly changing the external state.
The state of each endpoint is divided into two parts, one reflecting the state of the local endpoint, and the other reflecting the state of the remote endpoint as last communicated.
LOCAL:
UNINIT
ACTIVE
CLOSED
REMOTE:
UNINIT
ACTIVE
CLOSED
In total there are 9 possible states:
LOCAL REMOTE Example
-------------------------------------------------------------------------
UNINIT UNINIT A newly created connection.
UNINIT ACTIVE A remotely initiated connection
prior to full establishment.
UNINIT CLOSED A remotely initiated connection that
has been closed prior to full
establishment.
ACTIVE UNINIT A locally initiated connection prior
to full establishment.
ACTIVE ACTIVE A fully established connection.
ACTIVE CLOSED A remotely terminated connection.
CLOSED UNINIT A locally initiated connection that
has been closed prior to full
establishment.
CLOSED ACTIVE A locally terminated connection.
CLOSED CLOSED A fully terminated connection.
Additionally each endpoint has an error slot which may be filled with additional information regarding error conditions, e.g. why the remote endpoint was transitioned to CLOSED.