protected void NextResendRequest(Message resendReq) { try { // FIXME int begSeqNo = resendReq.GetInt(Fields.Tags.BeginSeqNo); int endSeqNo = resendReq.GetInt(Fields.Tags.EndSeqNo); this.Log.OnEvent("Got resend request from " + begSeqNo + " to " + endSeqNo); if ((endSeqNo == 999999) || (endSeqNo == 0)) { endSeqNo = state_.GetNextSenderMsgSeqNum() - 1; } List <string> messages = new List <string>(); state_.Get(begSeqNo, endSeqNo, messages); int current = begSeqNo; int begin = 0; int msgSeqNum = 0; foreach (string msgStr in messages) { Message msg = new Message(msgStr); msgSeqNum = msg.Header.GetInt(Tags.MsgSeqNum); if ((current != msgSeqNum) && begin == 0) { begin = current; } if (IsAdminMessage(msg)) { if (begin == 0) { begin = msgSeqNum; } } else { initializeResendFields(msg); if (begin != 0) { GenerateSequenceReset(begin, msgSeqNum); } Send(msg.ToString()); begin = 0; } current = msgSeqNum + 1; } if (begin != 0) { GenerateSequenceReset(begin, msgSeqNum + 1); } if (endSeqNo > msgSeqNum) { endSeqNo = endSeqNo + 1; int next = state_.GetNextSenderMsgSeqNum(); if (endSeqNo > next) { endSeqNo = next; } GenerateSequenceReset(begSeqNo, endSeqNo); } msgSeqNum = resendReq.Header.GetInt(Tags.MsgSeqNum); if (!IsTargetTooHigh(msgSeqNum) && !IsTargetTooLow(msgSeqNum)) { state_.IncrNextTargetMsgSeqNum(); } } catch (System.Exception e) { this.Log.OnEvent("ERROR during resend request " + e.Message); } }