Skip to content

wasip2: Deduplicate stream code in read/write/TCP#735

Merged
alexcrichton merged 1 commit intoWebAssembly:mainfrom
alexcrichton:refactor-read-and-write
Mar 3, 2026
Merged

wasip2: Deduplicate stream code in read/write/TCP#735
alexcrichton merged 1 commit intoWebAssembly:mainfrom
alexcrichton:refactor-read-and-write

Conversation

@alexcrichton
Copy link
Collaborator

This commit extends the support in #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.

@alexcrichton alexcrichton force-pushed the refactor-read-and-write branch 4 times, most recently from c29c9c6 to 071fc90 Compare February 24, 2026 19:21
@alexcrichton alexcrichton requested review from dicej and pchickey and removed request for pchickey February 27, 2026 21:13
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.
@alexcrichton alexcrichton force-pushed the refactor-read-and-write branch from 071fc90 to 5686bb2 Compare March 3, 2026 18:29
@alexcrichton alexcrichton enabled auto-merge (squash) March 3, 2026 18:30
@alexcrichton alexcrichton merged commit 426da18 into WebAssembly:main Mar 3, 2026
29 checks passed
@alexcrichton alexcrichton deleted the refactor-read-and-write branch March 3, 2026 18:51
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.

4 participants