Beispiel #1
0
        private void EnqueueOutput(TimestampedData timestampedData)
        {
            if (this._isStopping)
            {
                this._outputQueue.CompleteAdding();
                return;
            }

            if (_isPausing)
            {
                return;
            }

            this._outputQueue.Add(timestampedData);
        }
Beispiel #2
0
        private void Output(TimestampedData timestampedData)
        {
            // No filter, no pass
            if (!(this._filters?.PropertyFilters?.Any() ?? false))
            {
                return;
            }

            var packet = new IPPacket(timestampedData.Data);
            var match  = this._filters.FirstMatch(packet);

            if (match == MessageAttribute.NoMatch)
            {
                return;
            }

            timestampedData.HeaderLength = packet.HeaderLength;
            timestampedData.Protocol     = packet.Protocol;
            timestampedData.RouteMark    = match;

            this._output.Output(timestampedData);
            Interlocked.Increment(ref this._packetsCaptured);
        }