public ModbusTcpRequestHandler(TcpClient tcpClient, ModbusServer server) : base(server, 260)
        {
            _tcpClient     = tcpClient;
            _networkStream = tcpClient.GetStream();

            this.CTS.Token.Register(() => _networkStream.Close());

            base.Start();
        }
Esempio n. 2
0
        public ModbusRequestHandler(ModbusServer modbusServer, int bufferSize)
        {
            this.ModbusServer = modbusServer;
            this.FrameBuffer  = new ModbusFrameBuffer(bufferSize);

            this.LastRequest = Stopwatch.StartNew();
            this.IsReady     = true;

            this.CTS = new CancellationTokenSource();
        }