Skip to content

Incomplete Dispose of WatsonTCPServer #303

Open
@sancheolz

Description

@sancheolz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions