OnixS C++ CME iLink 3 Binary Order Entry Handler  1.8.0
API Documentation
Message Sequence Numbers

Understanding Message Sequencing

A single iLink 3 session can exist across multiple sequential (not concurrent) physical connections. Parties can connect and disconnect multiple times while maintaining a single iLink 3 session. That is, once the OnixS::CME::iLink3::Session::disconnect method is called, iLink 3 Connection is terminated. However, when iLink 3 Connection is terminated, the iLink 3 session doesn't end its lifetime. It is possible to continue the session later, using OnixS::CME::iLink3::Session::connect method again. In other words, iLink 3 Session is comprised of one or more iLink 3 connections.

Sequence numbers are initialized at the start of each iLink 3 session, starting at 1 (one), and incremented by each an application message throughout the session. Each session establishes an independent incoming and outgoing sequence series.

OnixS C++ CME iLink 3 Handler automatically synchronizes sequence numbers, while reconnecting during an iLink 3 session, on the basis of the information previously stored in the Handler log files.


Manipulating Message Sequence Numbers

Monitoring of the sequence numbers enables parties to synchronize applications gracefully, while reconnecting during an iLink 3 session. To get the expected sequence number of the next incoming message, the OnixS::CME::iLink3::Session::inSeqNum member is exposed, as well as the OnixS::CME::iLink3::Session::outSeqNum member, to get sequence number of the next outgoing message.

Resetting inbound and outbound message sequence numbers back to 1, for whatever reason, constitutes the beginning of a new iLink 3 session. The OnixS::CME::iLink3::Session::reset method must be used to back up the previous log files and reset the sequence numbers to 1. In such cases, a new UUID is generated.

Both OnixS::CME::iLink3::Session::inSeqNum and OnixS::CME::iLink3::Session::outSeqNum methods can be used to set expected sequence numbers manually before an iLink 3 connection is established. However, it is NOT recommended to use these properties to reset the message sequence numbers to 1 for the session. Instead, the OnixS::CME::iLink3::Session::reset method must be used.