public UdpInputListener(TimberWinR.Parser.UdpParameters arguments, CancellationToken cancelToken, int port = 5140)
            : base(cancelToken, "Win32-Udp")
        {
            _port = port;
            _receivedMessages = 0;
            _arguments = arguments;

            if (!string.IsNullOrEmpty(arguments.Type))
                SetTypeName(arguments.Type);

            // setup raw data processor
            _unprocessedRawData = new BlockingCollection<byte[]>();
            _rawDataProcessingThread = new Thread(ProcessDataLoop) { Name = "Win32-Udp-DataProcessor"};
            _rawDataProcessingThread.Start();

            // start listing to udp port
            StartListener();
        }
Esempio n. 2
0
        public UdpInputListener(TimberWinR.Parser.UdpParameters arguments, CancellationToken cancelToken, int port = 5140) : base(cancelToken, "Win32-Udp")
        {
            _port             = port;
            _receivedMessages = 0;
            _arguments        = arguments;

            if (!string.IsNullOrEmpty(arguments.Type))
            {
                SetTypeName(arguments.Type);
            }

            // setup raw data processor
            _unprocessedRawData      = new BlockingCollection <byte[]>();
            _rawDataProcessingThread = new Thread(ProcessDataLoop)
            {
                Name = "Win32-Udp-DataProcessor"
            };
            _rawDataProcessingThread.Start();

            // start listing to udp port
            StartListener();
        }