To establish a FIX connection as an Acceptor, the OnixS::FIX::Session::logonAsAcceptor method must be used.
To establish a FIX connection as an Initiator, the OnixS::FIX::Session::logonAsInitiator method must be used.
For timeout behavior, see Logon and Logout Timeouts.
To disconnect the session, the OnixS::FIX::Session::logout method must be used. This member implements a graceful closing of the FIX connection, as defined by the Standard.
The synchronous OnixS::FIX::Session::logonAsInitiator and OnixS::FIX::Session::logout methods wait for their respective acknowledgment messages. If no incoming data arrives, the receiver timeout is one heartbeat interval plus reasonable transmission time. A separate limit of three heartbeat intervals ends the wait if the acknowledgment is still missing. If either timeout expires, the method throws OnixS::FIX::TimeoutException.
If either timeout expires while waiting for Logon, the engine sends a Logout message, closes the FIX connection, and sets the session state to OnixS::FIX::SessionState::Disconnected.
Reasonable transmission time is a percentage of the heartbeat interval (20% by default). A session uses OnixS::FIX::Session::reasonableTransmissionTime when set; otherwise, it uses OnixS::FIX::EngineSettings::reasonableTransmissionTime. For these timeout calculations, a heartbeat interval of 0 uses 30 seconds.
A single FIX session can exist across multiple sequential (not concurrent) physical connections. Parties can connect and disconnect multiple times while maintaining a single FIX session. That is, once the OnixS::FIX::Session::logout method is called, FIX Connection is terminated, however, the FIX session life continues. It is possible to continue the same session later, using either OnixS::FIX::Session::logonAsAcceptor or OnixS::FIX::Session::logonAsInitiator methods again. In other words, FIX Session is comprised of one or more FIX connections.
When a FIX session is in the active state and there are some network issues the FIX Engine will try to restore the FIX connection in accordance with OnixS::FIX::EngineSettings::reconnectAttempts and OnixS::FIX::EngineSettings::reconnectInterval settings.