During the FIX session lifetime, state changes occur. The OnixS::FIX::Session class exposes the OnixS::FIX::Session::state member to determine in which state it currently resides.
The following table describes all possible FIX session states that can occur during its lifetime, as well as what a specific state means for a session with a particular role.
|Role == Acceptor||Role == Initiator|
|Disconnected||The session is disconnected.|
|LoginInProgress||The session is waiting for the initial Logon message.||The initial Logon message was sent, and the session is waiting for the acknowledgment Logon message.|
|Active||The session is fully established (after the successful Logon exchange).|
|Reconnecting||N/A (only session-initiator can be in this state).||Session-initiator is trying to restore the telecommunication link.|
|LogoutInProgress||The initial Logout message was sent, and the session is waiting for the acknowledgment Logout message.|
OnixS::FIX::ISessionListener class exposes OnixS::FIX::ISessionListener::onStateChange virtual function for its users.
Overriding this member in descendant classes provides an ability to be notified about all changes in state of a particular session.