mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 09:15:47 +00:00
47eabe7574
- Change _connectAndLazySemaphoreInitLock to a SemaphoreSlim and use it in ConnectAsync. - Rename it to _connectLock and only use it for connecting. Replace its other usages (on SessionSemaphore and NextChannelNumber) with Interlocked operations. - Remove AuthenticationConnection semaphore. This static member placed a process-wide limit on the number of connections an application can make. I agree with the argument in https://github.com/sshnet/SSH.NET/issues/409#issuecomment-457415542 (and in several other issues/PRs) that this should not be something that the library attempts to control. The last change broke a few tests which do things like making 100 connections. I was tempted to delete these tests as I don't think they have much value, but instead I just limited their concurrency. Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>