TcpMutex prevents concurrent requests
Closed this issue · 4 comments
nzbart commented
When querying multiple devices, some of which may time out, the requests don't happen in parallel. When querying, say 10 devices, this means the total time could be around 300 seconds instead of 30 seconds. This appears to be because there is a global process-wide lock called TcpMutex
:
Line 21 in 0bbc4d4
The TcpClient itself is one-per-instance:
Line 36 in 0bbc4d4
Would it be possible to reduce the scope of TcpMutex
to per-instance rather than per process?
Aldaviva commented
Oops that's a great point. I forgot that field was static. Thanks, I will work on this.
Aldaviva commented
Should be fixed, feel free to give this a try and let me know if it works for you.
Kasa.nupkg.zip (from build 25)