-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preventing Leakage of the RemotingSession #65
Conversation
If the client process crashes, then checking idle sessions will not be able to close the session, because the _rawMessageTransport.SendMessage call will throw an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merging.
Thanks for the PR! |
Yes, it was introduced after updating WatsonTCP to 6.05. WatsonTcpServer trows TaskCanceledException in Dispose().
|
This test fails starting from 6.0 version of WatsonTCP: var server = new WatsonTcpServer("127.0.0.1", 9000);
server.Events.MessageReceived += (_, _) => { Console.WriteLine("srecv"); };
server.Start();
var client = new WatsonTcpClient("127.0.0.1", 9000);
client.Events.MessageReceived += (_, _) => { Console.WriteLine("crecv"); };
client.Connect();
Task.Run(() => { client.SendAsync("aaa"); });
server.Dispose(); Reported dotnet/WatsonTcp#303 |
Hmm, sometimes this code sample throws another exception:
I've filed another issue about it — dotnet/WatsonTcp#304 |
If the client process crashes, then checking idle sessions will not be able to close the session, because the _rawMessageTransport.SendMessage call will throw an exception.