OnixS C++ ICE Binary Order Entry Handler 1.2.3
API Documentation
Loading...
Searching...
No Matches
Message Sequence Numbers

Message Sequencing

Each Session maintains two independent counters:

  • inbound sequence number: expected sequence number of the next incoming message from BGW (Session::inSeqNum()),
  • outbound sequence number: sequence number of the next outgoing message from the client session (Session::outSeqNum()).

For BUS connectivity, sequence numbers start from 1 for each new client connection.

According to the ICE technical specification, sequence numbers (sequenceId) are assigned by BGW to its outbound messages on a per-session basis. Those outbound sequence numbers are reset to 1 at the start of a new trading session during the exchange maintenance window. If a client disconnects and reconnects during the same trading session, BGW continues from the last sent sequence number. Clients cannot request or force a server-side reset mid-session.

The same specification also states that sequence numbers on inbound client messages are normally ignored by BGW and are used only for diagnostics in case a message cannot be decoded. Even so, the Handler still exposes Session::inSeqNum() and Session::outSeqNum() so applications can track, persist, restore, and troubleshoot the session state consistently.

Manipulating Message Sequence Numbers

To get the expected sequence number of the next incoming message, use OnixS::ICE::BOE::Session::inSeqNum(). To get the sequence number of the next outgoing client message, use OnixS::ICE::BOE::Session::outSeqNum().

See also
Restoring Session State