コード例 #1
0
ファイル: OofHistory.cs プロジェクト: YHZX2013/exchange_diff
        public void AppendEntry()
        {
            int num = (this.isNew || this.reader == null) ? 0 : this.reader.EntryCount;

            if (num >= 10000)
            {
                this.Trace <int>("History data reached the limit of {0} entries, append aborted.", 10000);
                return;
            }
            int num2 = this.senderAddress.Length;

            if (num2 > 1000)
            {
                this.Trace <int, ushort>("Sender address size {0} is over the limit of {1} bytes, append aborted.", num2, 1000);
                return;
            }
            int num3 = this.globalRuleId.Length;

            if (num3 > 1000)
            {
                this.Trace <int, ushort>("Global rule id size is over the limit of {0} bytes, append aborted.", num3, 1000);
                return;
            }
            OofHistoryWriter oofHistoryWriter = new OofHistoryWriter();

            oofHistoryWriter.Initialize(this.oofHistoryStream);
            oofHistoryWriter.AppendEntry(num + 1, this.senderAddress, this.globalRuleId);
            this.isNew = false;
        }
コード例 #2
0
ファイル: OofHistory.cs プロジェクト: YHZX2013/exchange_diff
 private void PrepareNewOofHistoryStream()
 {
     this.Trace("Resetting / Initializing OOF history stream.");
     OofHistoryWriter.Reset(this.oofHistoryStream);
     this.oofHistoryStream.Position = 0L;
     this.isNew = true;
 }