TCP - The IO operation has been aborted because of either a thread exit or an application request
Hello, I am trying to implement a class that connects to a server through TCP, receives a message, opens a server, then sends a message through that server to all connected clients. This class seems to work, however, incrementally I will receive:
and then eventually:
System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Net.Sockets.Socket>.GetResult(Int16 token) at System.Net.Sockets.TcpListener.<AcceptTcpClientAsync>g__WaitAndWrap|31_0(ValueTask`1 task) at ReversingMill1CommsService.Worker.ConnectAndSend() in Worker.cs:line 153
System.InvalidOperationException: Not listening. You must call the Start() method before calling this method. at ReversingMill1CommsService.Worker.ConnectAndSend() in Worker.cs:line 0
closing in favor of:
✅ This post has been marked as answered!