During the FIX session lifetime, state changes occur. OnixS::FIX::Session class exposes the OnixS::FIX::Session::getState 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.
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 particular session.
class SessionStateListener : public ISessionListener { public: virtual void Listener::onStateChange( Session::State newState, Session::State prevState, Session* sn) { std::clog << "\nSession's state is changed" << ". Previous state was " << Session::state2string(prevState) << ", new state is " << Session::state2string(newState) << std::endl; } };