Each Session maintains two independent counters: an inbound sequence number for received messages and an outbound sequence number for messages BGW sends. Outbound sequence numbers are assigned to all server → client messages (including heartbeats) and increment by 1 per message.
ICE resets BGW outbound sequence numbers to 1 at the start of each new exchange trading session (maintenance window). This timing follows the exchange’s trading-hours schedule; it is not a weekly reset, and it is not client-driven. If disconnect and reconnect is performed during the same trading session, BGW continues from the last sent number (no reset). Clients cannot request or force a server-side reset mid-session.
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 server message, use OnixS::ICE::BOE::Session::outSeqNum().