haraldh opened PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
[ ] Windows support
[ ] Put theListenFd
feature behind a cli options
[ ] Document theListenFd
feature
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
[ ] Windows support
[ ] Put theListenFd
feature behind a cli option
[ ] Document theListenFd
feature
bjorn3 created PR review comment:
I think this shouldn't be done by default. I think it should only give access if a commandline argument is passed to enable it. In addition it would be nice to have a commandline argument to manually specify ports to listen to without having to use systemd or some other external program to create the socket.
bjorn3 submitted PR review.
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [ ] Windows support
- [ ] Put the
ListenFd
feature behind a cli option- [ ] Document the
ListenFd
feature
haraldh submitted PR review.
haraldh created PR review comment:
See the
TODO
section in the PR comment :)
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [ ] Windows support
- [ ] Put the
ListenFd
feature behind a CLI option- [ ] Add CLI option to specify
ListenFd
s- [ ] Document the
ListenFd
feature
haraldh submitted PR review.
haraldh created PR review comment:
Happy to receive PRs to this draft :) Will add you as a co-author
bjorn3 submitted PR review.
bjorn3 created PR review comment:
Right. I honestly only looked at the source and barely at the description :sweat_smile:
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [ ] Windows support
- [ ] Put the
ListenFd
feature behind a CLI option- [ ] Add CLI option to specify
ListenFd
s- [ ] Document the
ListenFd
feature- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [ ] Put the
ListenFd
feature behind a CLI option- [ ] Add CLI option to specify
ListenFd
s- [ ] Document the
ListenFd
feature- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [x] Put the
ListenFd
feature behind a CLI option- [ ] Add CLI option to specify
ListenFd
s- [ ] Document the
ListenFd
feature- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [ ] Tokio implementation
- [x] Put the
ListenFd
feature behind a CLI option- [ ] Add CLI option to specify
ListenFd
s- [ ] Document the
ListenFd
feature- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [x] Tokio implementation
- [x] Put the
ListenFd
feature behind a CLI option- [ ] Add CLI option to specify
ListenFd
s- [ ] Document the
ListenFd
feature- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [x] Tokio implementation
- [x] Put the
ListenFd
feature behind a CLI option- [x] Add CLI option to specify
ListenFd
s- [ ] Document the
ListenFd
feature- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [x] Tokio implementation
- [x] Put the
ListenFd
feature behind a CLI option- [x] Add CLI option to specify
ListenFd
s- [ ] Document the
ListenFd
feature- [ ] Non-busy polling on Windows
- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [x] Tokio implementation
- [x] Put the
ListenFd
feature behind a CLI option- [x] Add CLI option to specify
ListenFd
s- [ ] Non-busy polling on Windows
- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
bjorn3 submitted PR review.
bjorn3 created PR review comment:
Wouldn't it make more sense to add a new preopen type returned by
fd_prestat_get
rather than using env vars? Also won't the current code conflict with the fds for pre-opened dirs?
haraldh submitted PR review.
haraldh created PR review comment:
My goal was to mimic the listenfd behavior 1:1 so you could reuse already written code.
The preopened dirs are inserted later on, IIRC.. I can recheck again.
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [x] Tokio implementation
- [ ] Followup PR with CLI option to specify
ListenFd
s- [ ] Non-busy polling on Windows
- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [x] Windows support
- [x] Tokio implementation
- [ ] Followup PR with CLI option to specify
ListenFd
s- [ ] Wasi definition of
Preopentype
for sockets (listener and stream, tcp and unix)- [ ] Non-busy polling on Windows
- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
The split of
listen
andstream
modules where mainly done because of the difference in::num_ready_bytes()
.TODO:
- [ ] Followup PR with CLI option to specify
ListenFd
s- [ ] Wasi definition of
Preopentype
for sockets (listener and stream, tcp and unix)- [ ] Non-busy polling on Windows
- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh updated PR #3711 from wasmtime_sock_accept
to main
.
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
TODO:
- [ ] Followup PR with CLI option to specify
ListenFd
s- [ ] Wasi definition of
Preopentype
for sockets (listener and stream, tcp and unix)- [ ] Non-busy polling on Windows
- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
haraldh edited PR #3711 from wasmtime_sock_accept
to main
:
Together with https://github.com/rust-lang/rust/pull/93158 this enables basic networking in rust.
TODO:
- [ ] Test cases
- [ ] Discussion of
SocketAddr
return value for::accept()
in the rustsrc PROk(( 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), ))
Followup Todo: * [ ] PR with CLI option to specify
ListenFd
s * [ ] Wasi definition ofPreopentype
for sockets (listener and stream, tcp and unix) * [ ] Non-busy polling on Windows
Last updated: Nov 22 2024 at 17:03 UTC