예제 #1
0
 protected virtual void StopFIXSimulation()
 {
     isFIXSimulationStarted = false;
     if (resetSequenceNumbersNextDisconnect)
     {
         resetSequenceNumbersNextDisconnect = false;
         if (debug)
         {
             log.Debug("Resetting sequence numbers because simulation rollover.");
         }
         remoteSequence = 1;
         fixFactory     = CreateFIXFactory(0, FixFactory.Sender, FixFactory.Destination);
     }
 }
예제 #2
0
 protected virtual void SetupFixFactory(MessageFIXT1_1 packet)
 {
     if (packet.IsResetSeqNum)
     {
         if (packet.Sequence != 1)
         {
             throw new InvalidOperationException("Found reset sequence number flag is true but sequence was " +
                                                 packet.Sequence + " instead of 1.");
         }
         if (debug)
         {
             log.Debug("Found reset seq number flag. Resetting seq number to " + packet.Sequence);
         }
         fixFactory     = CreateFIXFactory(packet.Sequence, packet.Target, packet.Sender);
         RemoteSequence = packet.Sequence;
     }
     else if (FixFactory == null)
     {
         throw new InvalidOperationException(
                   "FIX login message specified tried to continue with sequence number " + packet.Sequence +
                   " but simulator has no sequence history.");
     }
 }