sunfishcode opened PR #6837 from sunfishcode:sunfishcode/sockets
to bytecodealliance:main
:
Implement the
tcp
,tcp-create-socket
, andnetwork
interfaces of wasi-sockets.The test doesn't pass yet, because I haven't figured out how to get it to build and run properly yet.
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
sunfishcode requested alexcrichton for a review on PR #6837.
sunfishcode requested wasmtime-core-reviewers for a review on PR #6837.
sunfishcode requested wasmtime-default-reviewers for a review on PR #6837.
sunfishcode has marked PR #6837 as ready for review.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode has marked PR #6837 as ready for review.
pchickey submitted PR review:
This is excellent, I am very excited to see this land!
pchickey submitted PR review:
This is excellent, I am very excited to see this land!
pchickey created PR review comment:
_ => unreachable!(),
pchickey created PR review comment:
I guess we also set the state without making the pollable ready as well, so maybe there should be two methods for it?
set
andset_and_wake
?
pchickey created PR review comment:
I'm pretty sure this implementation is correct, but when I've needed this in the past I copy-pasted the unstable implementation out of
std
, and left a comment of its provenance and to replace it withstd::task::Waker::noop()
oncenoop_waker
stabilizes https://github.com/rust-lang/rust/pull/96875/files#diff-94c4720cc6dcbfa0ca91afcfe1f20fad1ff4e7ab403417110fb1af3305aad23e
pchickey created PR review comment:
Instead of panicking if this conversion fails, can we make this a TryFrom and trap execution instead?
pchickey created PR review comment:
Can we consolidate this pattern of setting the new state and then sending () into a single method?
pchickey created PR review comment:
Not a problem with this PR, but I guess I just realized there are competing whitespace styles in the wasi wits, so maybe someone needs to invent
witfmt
so we never have to think about them again
sunfishcode updated PR #6837.
sunfishcode submitted PR review.
sunfishcode created PR review comment:
The obvious
set
andset_and_wake
would require dropping and re-acquiring the lock. We don't need to worry about threads here just yet, but when we do, we'll need to hold onto that lock. So I factored out some different utility functions here, in a way that should still help ensure that we get the sequence right.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode has enabled auto merge for PR #6837.
sunfishcode updated PR #6837.
sunfishcode has enabled auto merge for PR #6837.
sunfishcode updated PR #6837.
sunfishcode has enabled auto merge for PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
sunfishcode updated PR #6837.
pchickey submitted PR review.
pchickey submitted PR review.
pchickey created PR review comment:
rather than listing these out explicitly, can you use
command::add_to_linker
to get them all?
pchickey created PR review comment:
from my reading of these changes,
set_state
is only ever performed when in an&mut self
method ofWasiView
, rather than in a spawned task, which makes me think theres no longer a need for an arc and locking for that member. Can we lift it out to be in HostTcpSocket and manipulate it with plain old &mut?
sunfishcode updated PR #6837.
sunfishcode submitted PR review.
sunfishcode created PR review comment:
Done
sunfishcode submitted PR review.
sunfishcode created PR review comment:
Done
sunfishcode merged PR #6837.
Last updated: Dec 23 2024 at 12:05 UTC