申明一个l变量,类型为ListenSocket<ModbusTcpSocket>模板类指针
Fixes #52 The correct cancellation of the ListenAsync method is based on https://stackoverflow.com/questions/19220957/tcplistener-how-to-stop-listening-while-awaiting-accepttcpclientasync. When cancelled the method will now throw a OperationCanceledExcep
@@ -113,15 +113,34 @@ public static ModbusTcpSlave CreateTcp(byte unitId, TcpListener tcpListener, dou public override async Task ListenAsync(CancellationToken cancellationToken = new CancellationToken()) { Logger.Information("Start Modbus Tcp Server."); ...