You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.
await Socket.ReceiveAsync( new ArraySegment( Buffer ), Ct );
cannot be cancelled on a ClientWebSocket when Ct is the CancellationToken.
Instead of throwing a OperationCanceledException and keeping the socket alive, the following exception is thrown and the socket is aborted:
System.Net.WebSockets.WebSocketException: The 'System.Net.WebSockets.InternalClientWebSocket' instance cannot be used for communication because it has been transitioned into the 'Aborted' state. ---> System.Net.Http.WinHttpException: The operation has been canceled
This is true for both the ClientWebSocket and on a server socket when WebListener is used.
When Kestrel is used, ReceiveAsync CAN be cancelled on the SERVER, the cancellation takes about 10 seconds though.
await Socket.ReceiveAsync( new ArraySegment( Buffer ), Ct );
cannot be cancelled on a ClientWebSocket when Ct is the CancellationToken.
Instead of throwing a OperationCanceledException and keeping the socket alive, the following exception is thrown and the socket is aborted:
System.Net.WebSockets.WebSocketException: The 'System.Net.WebSockets.InternalClientWebSocket' instance cannot be used for communication because it has been transitioned into the 'Aborted' state. ---> System.Net.Http.WinHttpException: The operation has been canceled
This is true for both the ClientWebSocket and on a server socket when WebListener is used.
When Kestrel is used, ReceiveAsync CAN be cancelled on the SERVER, the cancellation takes about 10 seconds though.
Minimal solution with both the client and server part to reproduce on Stack Overflow: http://stackoverflow.com/questions/34634652/dnx-core-websocket-clientwebsocket-receiveasync-cancellation-is-not-working-p
The text was updated successfully, but these errors were encountered: