wasi: implement sock_accept and enable networking#93158
Merged
bors merged 2 commits intorust-lang:masterfrom Jan 29, 2022
Merged
wasi: implement sock_accept and enable networking#93158bors merged 2 commits intorust-lang:masterfrom
sock_accept and enable networking#93158bors merged 2 commits intorust-lang:masterfrom
Conversation
Contributor
|
r? @dtolnay (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This was referenced Jan 21, 2022
4ab7b43 to
a0ce15c
Compare
This comment has been minimized.
This comment has been minimized.
a0ce15c to
62b4e72
Compare
sock_accept and enable networkingsock_accept and enable networking
8 tasks
dtolnay
requested changes
Jan 28, 2022
Member
dtolnay
left a comment
There was a problem hiding this comment.
Thanks, this looks good to me after the fix in decode_error_kind.
Feel free to ping anyone who would have a useful opinion about the TcpListener::accept return value. Probably any value is better than unsupported() though.
library/std/src/os/wasi/net/mod.rs
Outdated
Member
There was a problem hiding this comment.
.as_inner().as_inner().as_inner()
😱
library/std/src/sys/wasi/mod.rs
Outdated
Member
There was a problem hiding this comment.
Line 66 has this already.
Suggested change
| e if e == wasi::ERRNO_AGAIN.raw().into() => WouldBlock, |
To make use of `sock_accept()`, update the wasi crate to `0.11.0`. Signed-off-by: Harald Hoyer <harald@profian.com>
With the addition of `sock_accept()` to snapshot1, simple networking via a passed `TcpListener` is possible. This patch implements the basics to make a simple server work. Signed-off-by: Harald Hoyer <harald@profian.com>
62b4e72 to
d2a1369
Compare
Contributor
Author
@dtolnay fixed and rebased |
dtolnay
approved these changes
Jan 28, 2022
Member
|
@bors r+ |
Collaborator
|
📌 Commit d2a1369 has been approved by |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 28, 2022
wasi: implement `sock_accept` and enable networking With the addition of `sock_accept()` to snapshot1, simple networking via a passed `TcpListener` is possible. This PR implements the basics to make a simple server work. See also: * [wasmtime tracking issue](bytecodealliance/wasmtime#3730) * [wasmtime PR](bytecodealliance/wasmtime#3711) TODO: * [ ] Discussion of `SocketAddr` return value for `::accept()` ```rust Ok(( TcpStream::from_inner(unsafe { Socket::from_raw_fd(fd as _) }), // WASI has no concept of SocketAddr yet // return an unspecified IPv4Addr SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), 0), )) ```
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 28, 2022
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#92611 (Add links to the reference and rust by example for asm! docs and lints) - rust-lang#93158 (wasi: implement `sock_accept` and enable networking) - rust-lang#93239 (Add os::unix::net::SocketAddr::from_path) - rust-lang#93261 (Some unwinding related cg_ssa cleanups) - rust-lang#93295 (Avoid double panics when using `TempDir` in tests) - rust-lang#93353 (Unimpl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}<$t> for Saturating<$t>) - rust-lang#93356 (Edit docs introduction for `std::cmp::PartialOrd`) - rust-lang#93375 (fix typo `documenation`) - rust-lang#93399 (rustbuild: Fix compiletest warning when building outside of root.) - rust-lang#93404 (Fix a typo from rust-lang#92899) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
haraldh
added a commit
to haraldh/mio
that referenced
this pull request
Feb 4, 2022
With * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Signed-off-by: Harald Hoyer <harald@profian.com>
haraldh
added a commit
to haraldh/mio
that referenced
this pull request
Feb 15, 2022
With * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Signed-off-by: Harald Hoyer <harald@profian.com>
haraldh
added a commit
to haraldh/mio
that referenced
this pull request
Feb 15, 2022
With * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Signed-off-by: Harald Hoyer <harald@profian.com>
This was referenced Feb 15, 2022
haraldh
added a commit
to haraldh/mio
that referenced
this pull request
Feb 15, 2022
With * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Signed-off-by: Harald Hoyer <harald@profian.com>
haraldh
added a commit
to haraldh/mio
that referenced
this pull request
Feb 18, 2022
With * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Signed-off-by: Harald Hoyer <harald@profian.com>
haraldh
added a commit
to haraldh/mio
that referenced
this pull request
Feb 21, 2022
Based on tokio-rs#1395 And with * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com> Signed-off-by: Harald Hoyer <harald@profian.com>
haraldh
added a commit
to haraldh/mio
that referenced
this pull request
Mar 8, 2022
Based on tokio-rs#1395 And with * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com> Signed-off-by: Harald Hoyer <harald@profian.com>
Thomasdezeeuw
added a commit
to tokio-rs/mio
that referenced
this pull request
Mar 8, 2022
Based on #1395 And with * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com> Signed-off-by: Harald Hoyer <harald@profian.com>
bdbai
pushed a commit
to YtFlow/mio-noafd
that referenced
this pull request
May 15, 2022
Based on tokio-rs#1395 And with * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com> Signed-off-by: Harald Hoyer <harald@profian.com>
stlankes
added a commit
to hermit-os/mio
that referenced
this pull request
Jun 30, 2022
Based on tokio-rs#1395 And with * bytecodealliance/wasmtime#3711 * rust-lang/rust#93158 merged, mio can have limited support for networking for the `wasm32-wasi` target. Co-authored-by: Thomas de Zeeuw <thomasdezeeuw@gmail.com> Signed-off-by: Harald Hoyer <harald@profian.com>
6 tasks
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.
With the addition of
sock_accept()to snapshot1, simple networking via a passedTcpListeneris possible. This PR implements the basics to make a simple server work.See also:
TODO:
SocketAddrreturn value for::accept()