Each Session maintains two independent counters:
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.
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().