parallelbgls / Modbus.Net

A high extensible hardware communication platform using C#
MIT License
376 stars 136 forks source link

群主,这里异步需要加一个lock吧... #9

Closed pigwing closed 1 year ago

pigwing commented 6 years ago

https://github.com/parallelbgls/Modbus.Net/blob/d5bc2881c9029f54f42d93366382936d37118aff/Modbus.Net/src/Base.Common/TcpConnector.cs#L276

private readonly AsyncLock _mutex = new AsyncLock(); public async Task UseLockAsync() { // AsyncLock can be locked asynchronously using (await _mutex.LockAsync()) { // It's safe to await while the lock is held await Task.Delay(TimeSpan.FromSeconds(1)); } }

parallelbgls commented 6 years ago

7

parallelbgls commented 1 year ago

由于TCP和UDP已经修改为DotNetty,这个漏洞不存在了。 串口依然有需要修正的地方。请关注 #7 。 这个Issue关闭。