badeend opened PR #7243 from badeend:udp-streams
to bytecodealliance:main
:
Introduce new
inbound-datagram-stream
andoutbound-datagram-stream
types and movedreceive
andsend
methods to those respectively. These streams are returned bybind
and can be individually subscribed to. This resolves a design issue where a UDP server would end up in a spin loop becausereceive
returned EWOULDBLOCK but poll_* always returned immediately because the socket was ready for sending. In this new setup, users can poll each direction separately. Fixes https://github.com/WebAssembly/wasi-sockets/issues/64Additionally
- Enable send-like behaviour by making
outbound-datagram::remote-address
optional. Fixes https://github.com/WebAssembly/wasi-sockets/pull/57- Dropped the
network
parameter from theconnect
call, becausebind
is now _required_ to perform IO.
badeend requested alexcrichton for a review on PR #7243.
badeend requested wasmtime-core-reviewers for a review on PR #7243.
badeend updated PR #7243.
badeend updated PR #7243.
badeend updated PR #7243.
alexcrichton submitted PR review:
Looks great to me, thanks again for this!
badeend updated PR #7243.
alexcrichton merged PR #7243.
Last updated: Dec 23 2024 at 12:05 UTC