OnixS C++ FIX Engine  4.10.1
API Documentation
Resetting Message Sequence Numbers via ResetSeqNumFlag Field

ResetSeqNumFlag (141) field in the Logon (A) message indicates that both sides of the FIX Session should reset sequence numbers.

To send a Logon (A) message with this field during FIX Connection establishment, use the setResetSeqNumFlag parameter of the OnixS::FIX::Session::logonAsInitiator method.

Some FIX venues do not support this flag.
Only the first Logon message will be sent with the ResetSeqNumFlag flag. If subsequent Logon messages are sent during the automatic attempts to restore the FIX connection they will be sent without this flag.

To send a Logon message with the ResetSeqNumFlag flag, each time the Logon message is sent to set this flag in the Custom Logon message (Connecting using Custom Logon Message). The local incoming sequence number will be reset after counterparty replies with Logon message. If counterparty will reject Logon message, a local incoming sequence number still has an old value. If there is a need to reset the local sequence numbers to 1 during every logon, the OnixS::FIX::Session::resetLocalSequenceNumbersOnLogon option should be set to true.

It is also possible to send a Logon (A) message with the ResetSeqNumFlag (141) set when the FIX Session is established (e.g. to maintain 24 hour connectivity), using the OnixS::FIX::Session::resetSeqNumViaLogonExchange method.

Some of FIX venues replies to the initial Logon without ResetSeqNumFlag flag by the Logon with ResetSeqNumFlag flag. This case is not covered by the FIX protocol. Therefore, in such cases, if a Logon is initiated without ResetSeqNumFlag flag, then the FIX Engine will track it and if the confirmation Logon contains ResetSeqNumFlag flag, then the FIX Engine will send another confirmation Logon with ResetSeqNumFlag flag to the counterparty. This Logon should be considered as a confirmation Logon to reset sequence numbers. In order to work it properly, one needs to use only ways, described on this page, to set ResetSeqNumFlag flag. For example, you should not set this flag manually inside the outbound callback.