Skip to content

Commit 47eabe7

Browse files
Tweak semaphore usage in Session (#1304)
- 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 #409 (comment) (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 <[email protected]>
1 parent 54a001a commit 47eabe7

File tree

3 files changed

+185
-220
lines changed

3 files changed

+185
-220
lines changed

0 commit comments

Comments
 (0)