Open
Conversation
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR advances the browser-WASM “no sockets” effort by making networking/socket-related components consistently unavailable on the browser target, aligning with the broader PAL cleanup work.
Changes:
- Add browser-specific System.Native stubs for networking, interface addresses, and network statistics.
- Switch browser builds away from syscall-trimming JS hacks and toward native/CMake-based stubbing/linking behavior.
- Add a
-browserTFM forSystem.Net.Socketsthat builds as a PlatformNotSupported assembly.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/libs/System.Native/pal_networkstatistics_wasm.c | Adds WASM/browser stub implementations for network statistics APIs. |
| src/native/libs/System.Native/pal_networking_browser.c | Adds browser stub implementations for System.Native networking/socket entrypoints. |
| src/native/libs/System.Native/pal_interfaceaddresses_browser.c | Adds browser stub implementations for interface/gateway enumeration. |
| src/native/libs/System.Native/CMakeLists.txt | Selects browser-specific PAL sources for System.Native. |
| src/native/eventpipe/ds-ipc-pal-websocket.c | Adds missing runtime helpers for standalone PAL websocket IPC path. |
| src/native/corehost/browserhost/libBrowserHost.footer.js | Removes syscall override hooks previously used to “trim” sockets. |
| src/mono/mono/profiler/log.c | Gates socket header inclusion on configure-time header availability. |
| src/mono/mono/profiler/helper.c | Gates socket-related includes on configure-time header availability. |
| src/mono/mono/profiler/aot.c | Gates socket header inclusion on configure-time header availability. |
| src/mono/mono/mini/cfgdump.c | Gates socket header inclusion on configure-time header availability. |
| src/libraries/System.Net.Sockets/src/System.Net.Sockets.csproj | Adds -browser TFM and marks it as PlatformNotSupported. |
| eng/native/tryrun.browser.cmake | Disables HAVE_SYS_SOCKET_H for browser to avoid emscripten socket emulation. |
| eng/native/configureplatform.cmake | Adds browser CoreCLR link options (-nostdlib + explicit libs). |
This was referenced Feb 13, 2026
b31af63 to
eb1d810
Compare
jkotas
approved these changes
Feb 13, 2026
Member
jkotas
left a comment
There was a problem hiding this comment.
LGTM
It would be nice if folks with more detailed understanding of networking and/or wasm signoff as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation from #123962 (comment)
Contributes to #122506
Browser variant of
System.Net.Socketsnow throw PNSE for all members.SocketAddressPal.Browser.csdoesn't talk to posix and it's shallow similar toSocketAddressPal.Windows.cs