Async network operations never finish
I have several asynchronous network operations that return a task that may never finish: UdpClient.ReceiveAsync doesn't accept a CancellationToken TcpClient.GetStream returns a NetworkStream that doesn't respect the CancellationToken on Stream.ReadAsync (checking for cancellation only at the start of the operation) Both wait for a message that may never come (because of packet loss or no response for example). That means I have phantom tasks that never complete, continuations that will never run and used sockets on hold. I know i can use TimeoutAfter , but that will only fix the continuation