-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-System.Runtime.InteropServices.JavaScriptos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
Milestone
Description
If we do:
connect wb, server sends a message and closes
scenario 1): Client waits some time, calls ReceiveAsync -> client receives the buffered message, no exception because managed code did not update the ws's state.
scenario 2): Client waits some time, checks the server's state by accessing WebSocket.State, calls ReceiveAsync -> exception, Unhandled exception rendering component: The WebSocket is in an invalid state ('Closed') for this operation. Valid states are: 'Open, CloseSent' because by accessing State property we made the closing state propagate to C#.
Internally we don't use State but FastState. Only getting State triggers JS interop.
pavelsavara
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-System.Runtime.InteropServices.JavaScriptos-browserBrowser variant of arch-wasmBrowser variant of arch-wasm