You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.
protectedvoidStartClient(){if(!_server.IsOpen())thrownew HeliosException("Server is not started yet. Cannot start client yet.");_client= _clientConnectionFactory.NewConnection(_server.Local);
_client.Receive +=(data,channel)=>{if(!HighPerformance){ ClientReceiveBuffer.Add(data);} ClientReceived.GetAndIncrement();};
_client.OnConnection +=(address,channel)=> channel.BeginReceive();
_client.OnError +=(exception,connection)=> _clientExecutor.Exceptions.Add(exception);
_client.Open();}
While the _client.Open() call is still being executed, the _client.OnConnection event fires and channel.BeginReceive() fires before _client.Open() has a chance to finished.
The text was updated successfully, but these errors were encountered:
Hilarious race condition with this code...
While the _client.Open() call is still being executed, the _client.OnConnection event fires and
channel.BeginReceive()
fires before _client.Open() has a chance to finished.The text was updated successfully, but these errors were encountered: