Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Conversation

@rvolosatovs
Copy link
Contributor

accept is fallible, however there is currently no way to report the error to the user from the stream.

Change the stream element type to result<tcp-stream, error-code> to account for that

Ref https://www.man7.org/linux/man-pages/man2/accept.2.html
Ref https://github.com/bytecodealliance/wasip3-prototyping/blob/7dbc8a9fd6a2348e772a32382c3e29c88cad397e/crates/wasi/src/p3/sockets/host/types/tcp.rs#L195-L199

Ref bytecodealliance/wasip3-prototyping#1

`accept` is fallible, however there is currently no way to report the
error to the user from the stream.

Change the stream element type to `result<tcp-stream, error-code>` to
account for that

Ref https://www.man7.org/linux/man-pages/man2/accept.2.html
Ref https://github.com/bytecodealliance/wasip3-prototyping/blob/7dbc8a9fd6a2348e772a32382c3e29c88cad397e/crates/wasi/src/p3/sockets/host/types/tcp.rs#L195-L199

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs
Copy link
Contributor Author

I guess I'll just go for this option:

/// - Synthesize a `tcp-socket` resource that exposes the error when
/// attempting to send or receive on it. Guest code then sees these
/// failures as regular I/O errors.

@rvolosatovs rvolosatovs deleted the feat/fallible-accept branch February 12, 2025 15:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant