Closed
Description
The code below contains a race condition (ZyanConnection,cs, line 200):
var registeredChannel = ChannelServices.GetChannel(_remotingChannel.ChannelName);
if (registeredChannel == null)
ChannelServices.RegisterChannel(_remotingChannel, false);
else
_remotingChannel = registeredChannel;
The race condition can affect the application startup if the application opens many connections in parallel.
Something like this:
var protocol = new AnyClientProtocolSetup(...);
ThreadPool.QueueUserWorkItem(x => CreateConnection(protocol, url1));
ThreadPool.QueueUserWorkItem(x => CreateConnection(protocol, url2));
ThreadPool.QueueUserWorkItem(x => CreateConnection(protocol, url3));
Metadata
Metadata
Assignees
Labels
No labels