Call the following method to create a session:
After the session is created, use one of the methods below to connect to it as an initiator.
For example:
After B2BITS_Session_ConnectInitiator is called the initiator attempts to establish a FIX session in the background. The following scenario is executed:
The initiator is responsible for restoring connection once it is broken. When connection error is detected the initiator moves to the "Reconnect" state and starts a reconnection process. The following scenario is executed:
The number of reconnection attempts and delay can be set in the properties file (see Reconnect.MaxTries and Reconnect.Interval). Refer to Configuration for more details.
Use the following methods to disconnect the initiator (this process can be also called "terminate", "delete", "close"):
aMarkAsTerminated parameter is used to set the desired state after disconnection. If it is set to "true" the initiator tries to disconnect gracefully (i.e. execute logout procedure). If it is set to "false" the initiator moves to the non-gracefully terminated state.
Use the Engine::Session::release() method to release the allocated resources.
It is vital to call B2BITS_Session_RegisterApplication(pSA, NULL, NULL, 1, 0) before calling the release method.
It is vital to call the B2BITS_Session_Release(B2BITS_Session sn) method only once for the given session.
To send outgoing application-level messages, use the B2BITS_Session_Put(B2BITS_FIXMessage msg) method.
All session level messages are send automatically when needed.