wasip3: Finish nonblocking I/O implementation for TCP#782
Merged
alexcrichton merged 6 commits intoWebAssembly:mainfrom Apr 13, 2026
Merged
wasip3: Finish nonblocking I/O implementation for TCP#782alexcrichton merged 6 commits intoWebAssembly:mainfrom
alexcrichton merged 6 commits intoWebAssembly:mainfrom
Conversation
This commit fills out the final bits of nonblocking I/O for TCP sockets. This necessitates an implementation of nonblocking I/O for `stream<u8>` on both the reading and the writing side of things. Additionally things like TCP accepts now work, too. All tests are now passing on the WASIp3 target and the `FAILP3` directive is now removed since it's no longer necessary. The internals of the implementation here are pretty gnarly. This is due to the need to bridge the readiness-based-model of `poll` with the completion-based model of the component model. This implementation contains optimizations for 0-length reads/writes to use those to signal readiness if the host supports that, but this falls back to internally-buffered reads/writes if that is not supported. This should resolve all remaining TODOs for WASIp3 that I know of at least in wasi-libc, so after this it'd be switching to bug-finding mode and handling bug reports as projects are compiled with wasip3.
Collaborator
Author
|
cc @badeend, would you be willing to take a look at this? I realize that you may not be the most familiar with this code so it's totally fine if you'd rather not, too. |
dicej
approved these changes
Apr 9, 2026
dicej
reviewed
Apr 9, 2026
Co-authored-by: Joel Dice <joel.dice@akamai.com>
Collaborator
Author
|
I'm going to go ahead and merge this @badeend but I'd still value your input if you get a chance in the future to take a look, happy to have follow-ups! |
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.
This commit fills out the final bits of nonblocking I/O for TCP sockets. This necessitates an implementation of nonblocking I/O for
stream<u8>on both the reading and the writing side of things. Additionally things like TCP accepts now work, too. All tests are now passing on the WASIp3 target and theFAILP3directive is now removed since it's no longer necessary.The internals of the implementation here are pretty gnarly. This is due to the need to bridge the readiness-based-model of
pollwith the completion-based model of the component model. This implementation contains optimizations for 0-length reads/writes to use those to signal readiness if the host supports that, but this falls back to internally-buffered reads/writes if that is not supported.This should resolve all remaining TODOs for WASIp3 that I know of at least in wasi-libc, so after this it'd be switching to bug-finding mode and handling bug reports as projects are compiled with wasip3.