Skip to content

support non-blocking wasip2 sockets in read and write#734

Merged
alexcrichton merged 2 commits intoWebAssembly:mainfrom
dicej:wasip2-read-write-non-blocking-sockets
Feb 12, 2026
Merged

support non-blocking wasip2 sockets in read and write#734
alexcrichton merged 2 commits intoWebAssembly:mainfrom
dicej:wasip2-read-write-non-blocking-sockets

Conversation

@dicej
Copy link
Contributor

@dicej dicej commented Feb 12, 2026

For descriptors which have sendto and recvfrom in their vtables, use those for writing and reading respectively since they know how to handle non-blocking descriptors.

In the future, we could generalize this to support non-blocking descriptors which aren't sockets, also.

For descriptors which have `sendto` and `recvfrom` in their vtables, use those
for writing and reading respectively since they know how to handle non-blocking
descriptors.

In the future, we could generalize this to support non-blocking descriptors
which aren't sockets, also.
@dicej dicej force-pushed the wasip2-read-write-non-blocking-sockets branch from 524386b to 78b03b1 Compare February 12, 2026 23:00
@alexcrichton alexcrichton merged commit 55cc34a into WebAssembly:main Feb 12, 2026
28 checks passed
alexcrichton added a commit to alexcrichton/wasi-libc that referenced this pull request Feb 13, 2026
This commit extends the support in WebAssembly#734 by deduplicating the separate
paths for reading a stream shared between `read` and `recvfrom`, for
example. The `get_{read,write}_stream` methods now return more metadata
and the TCP `recvfrom` implementation delegates to an internal
`__wasilibc_read` to perform the actual read. This opens up the door to
supporting nonblocking reads/writes on other streams in the future, for
example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants