Skip to content
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

Incomplete Dispose of WatsonTCPServer #303

Open
sancheolz opened this issue Nov 14, 2024 · 0 comments
Open

Incomplete Dispose of WatsonTCPServer #303

sancheolz opened this issue Nov 14, 2024 · 0 comments

Comments

@sancheolz
Copy link

sancheolz commented Nov 14, 2024

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();

It throws

System.AggregateException : One or more errors occurred. (A task was canceled.)
  ----> System.Threading.Tasks.TaskCanceledException : A task was canceled.
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at WatsonTcp.WatsonTcpServer.Dispose(Boolean disposing) in WatsonTcpServer.cs:line 621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant