示例#1
0
 public void Run(Action terminationCallback = null)
 {
     // Start listening on the specified port, and get callback whenever
     // new socket connection is established.
     _listener.Start(socket =>
     {
         // New connection. Start reading data from the network stream.
         // Socket stream reader will call back when a valid value is read
         // and/or when a terminate command is received.
         var reader = new SocketStreamReader(socket);
         reader.Handle(_nodeListManager);
     });
 }
示例#2
0
        public void Run(Action terminationCallback = null)
        {
            _reporter.Start(_statusInterval);

            // Start listening on the specified port, and get callback whenever
            // new socket connection is established.
            _listener.Start(socket =>
            {
                // New connection. Start reading data from the network stream.
                // Socket stream reader will call back when a valid value is read
                // and/or when a terminate command is received.
                var reader = new SocketStreamReader(socket);
                reader.Read(ProcessValue, terminationCallback);
            });
        }