Using Microsoft.AspNetCore 2.1.0-preview1-final we get this exception on ReceiveAsync. The usage is quite ordinary and we didn't get any errors on the earlier builds. The first thing we do after we accept the socket is:
result = await currentSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None)
And here's the exception:
System.Net.WebSockets.WebSocketException (0x80004005): The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseSent'
at System.Net.WebSockets.WebSocketValidate.ThrowIfInvalidState(WebSocketState currentState, Boolean isDisposed, WebSocketState[] validStates)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsync(ArraySegment`1 buffer, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Using Microsoft.AspNetCore 2.1.0-preview1-final we get this exception on ReceiveAsync. The usage is quite ordinary and we didn't get any errors on the earlier builds. The first thing we do after we accept the socket is:
result = await currentSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None)And here's the exception: