You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Settings EnableNextExpectedMsgSeqNum not works well #716
// NextTargetMsgSeqNum returns the next MsgSeqNum that should be received
func (store *fileStore) NextTargetMsgSeqNum() int {
return store.cache.NextTargetMsgSeqNum()
}
...
// Evaluate tag 789.
if s.EnableNextExpectedMsgSeqNum {
if inReplyTo != nil {
targetWantsNextSeqNumToBe, getErr := inReplyTo.Body.GetInt(tagNextExpectedMsgSeqNum)
if getErr == nil {
actualNextNum := s.store.NextSenderMsgSeqNum()
// // Is the 789 we received too high ??
if targetWantsNextSeqNumToBe > actualNextNum {
// we can't resend what we never sent! something unrecoverable has happened.
return RejectLogon{fmt.Sprintf("Tag 789 (NextExpectedMsgSeqNum) is higher than expected. Expected %d, Received %d", actualNextNum, targetWantsNextSeqNumToBe)}
}
nextSeqNum := s.store.NextTargetMsgSeqNum()
logon.Body.SetField(tagNextExpectedMsgSeqNum, FIXInt(nextSeqNum+1))
}
} else {
// We are sending a logon.
nextseqnum := s.store.NextTargetMsgSeqNum()
logon.Body.SetField(tagNextExpectedMsgSeqNum, FIXInt(nextseqnum+1))
}
}
NextTargetMsgSeqNum means next MsgSeqNum that should be received
if it equals to the NextExpectedMsgSeq?needn't +1?
if s.EnableNextExpectedMsgSeqNum {
if inReplyTo != nil {
targetWantsNextSeqNumToBe, getErr := inReplyTo.Body.GetInt(tagNextExpectedMsgSeqNum)
if getErr == nil {
actualNextNum := s.store.NextSenderMsgSeqNum()
// // Is the 789 we received too high ??
if targetWantsNextSeqNumToBe > actualNextNum {
// we can't resend what we never sent! something unrecoverable has happened.
return RejectLogon{fmt.Sprintf("Tag 789 (NextExpectedMsgSeqNum) is higher than expected. Expected %d, Received %d", actualNextNum, targetWantsNextSeqNumToBe)}
}
nextSeqNum := s.store.NextTargetMsgSeqNum()
logon.Body.SetField(tagNextExpectedMsgSeqNum, FIXInt(nextSeqNum+1))
}
} else {
// We are sending a logon.
nextseqnum := s.store.NextTargetMsgSeqNum()
logon.Body.SetField(tagNextExpectedMsgSeqNum, FIXInt(nextseqnum))
}
}```
if inReplyTo != nil nextSeqNum+1,else nextseqnum
Activity
BingerCoder commentedon May 22, 2025
...
NextTargetMsgSeqNummeansnext MsgSeqNum that should be receivedif it equals to the NextExpectedMsgSeq?needn't +1?
BingerCoder commentedon May 22, 2025