alexcrichton opened PR #11386 from alexcrichton:wasi-sockets-tcp-refactor to bytecodealliance:main:
This is the same as #11384 except for
TcpSocketto share the implementation of TCP across WASIp{2,3} and avoid duplicating code between the two.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested wasmtime-wasi-reviewers for a review on PR #11386.
alexcrichton requested dicej for a review on PR #11386.
alexcrichton updated PR #11386.
alexcrichton requested wasmtime-core-reviewers for a review on PR #11386.
pchickey requested rvolosatovs for a review on PR #11386.
rvolosatovs submitted PR review:
It's a bit hard to keep track of all the changes, but I checked out the code locally to do a little overview and changes look good to me.
Is changing the wasip2 socket behavior a concern at all? (e.g.
TcpSocket::newnow returning "access denied")
rvolosatovs created PR review comment:
let mut buf = Vec::with_capacity(DEFAULT_BUFFER_CAPACITY);not introduced in this PR, but since we're changing all of these anyway, perhaps good to fix this one
alexcrichton updated PR #11386.
alexcrichton commented on PR #11386:
It's an intentional change yeah as I think it makes more sense to gate creation of sockets rather than gate operations on the sockets since it consolidates the check into just one place instead of having it spread out. It's also non-standard behavior in the sense that it's not specified in WASI itself, so it should be ok to tweak it's behavior over time. While the error is shuffled around disabling TCP and/or UDP still has the same effect where you can't do anything TCP/UDP-related once the options are disabled.
alexcrichton has enabled auto merge for PR #11386.
alexcrichton merged PR #11386.
Last updated: Dec 06 2025 at 07:03 UTC