示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProtocolMonitor"/> class.
        /// </summary>
        /// <param name="session">The protocol session instance.</param>
        public ProtocolMonitor()
        {
            this.exclusiveLock = new object();

            this.totals        = new ProtocolMonitorLog();
            this.exitEvent     = new ManualResetEvent(false);
            this.statsByStream = new StreamStats();
            this.State         = MonitorState.MonitorOff;
            this.savedStats    = new Dictionary <int, StatisticsSnapshot>();
            this.LastStartDate = DateTime.Now;
            this.LastEndDate   = this.LastStartDate;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProtocolMonitor"/> class.
        /// </summary>
        /// <param name="session">The sm session instance.</param>
        public ProtocolMonitor(SMSession session)
        {
            this.exclusiveLock = new object();

            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            this.totals        = new ProtocolMonitorLog();
            this.session       = session;
            this.exitEvent     = new ManualResetEvent(false);
            this.statsByStream = new StreamStats();
            this.State         = MonitorState.MonitorOff;
            this.savedStats    = new Dictionary <int, StatisticsSnapshot>();
            this.LastStartDate = DateTime.Now;
            this.LastEndDate   = this.LastStartDate;
        }