Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[browser][MT] WebSocket thread affinity & server initiated close #96618

Merged
merged 12 commits into from
Jan 16, 2024

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Jan 8, 2024

  • BrowserWebSocket now uses automatic dispatch to correct thread via JSSynchronizationContext & JSProxyContext & JS object affinity
  • onClosed event doesn't call back to C#
    • simplifies locking for MT
    • doesn't allocate Delegate/Function proxy
  • fix CloseReceived and CloseSent states
  • enabled CloseAsync_ServerInitiatedClose_Success
  • new test CloseOutputAsync_ServerInitiated_CanReceive
  • System.Net.WebSockets.Client.Tests now also run xunit on thread pool in MT
  • cross-thread WS tests in WebWorkerTest

Fixes #65796
Fixes #96173

Contributes to #96359
With partial/loose backport for Net8 #97002

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm labels Jan 8, 2024
@pavelsavara pavelsavara added this to the 9.0.0 milestone Jan 8, 2024
@pavelsavara pavelsavara requested review from kg and maraf January 8, 2024 12:21
@pavelsavara pavelsavara self-assigned this Jan 8, 2024
@ghost
Copy link

ghost commented Jan 8, 2024

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • BrowserWebSocket now uses automatic dispatch to correct thread via JSSynchronizationContext & JSProxyContext & JS object affinity
  • onClosed event doesn't call back to C#
    • simplifies locking for MT
    • doesn't allocate Delegate/Function proxy
  • System.Net.WebSockets.Client.Tests now also run xunit on thread pool in MT
Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript, os-browser

Milestone: 9.0.0

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara pavelsavara marked this pull request as ready for review January 11, 2024 16:01
pavelsavara and others added 2 commits January 15, 2024 17:42
…ockets/BrowserWebSockets/BrowserInterop.cs

Co-authored-by: Marek Fišera <mara@neptuo.com>
…ockets/BrowserWebSockets/BrowserInterop.cs

Co-authored-by: Marek Fišera <mara@neptuo.com>
@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
Copy link
Member Author

/azp run runtime-wasm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Runtime.InteropServices.JavaScript os-browser Browser variant of arch-wasm
Projects
None yet
3 participants