-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the remaining socket-related WASI functions. #4776
Implement the remaining socket-related WASI functions. #4776
Conversation
The original WASI specification included `sock_read`, `sock_write`, and `shutdown`. Now that we have some sockets support, implement these additional functions, to make it easier for people porting existing code to WASI. It's expected that this will all be subsumed by the wasi-sockets proposal, but for now, this is a relatively small change which should hopefully unblock people trying to use the current `accept` support.
373b427
to
79a5481
Compare
Subscribe to Label Actioncc @kubkon
This issue or pull request has been labeled: "wasi"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks right to me! edit: although apparently CI disagrees 😅
Windows disagrees 🙃 |
I assume cargo-vet is going to need a delta audit for |
I am not sure I see how sock_shutdown is intended to be used if the socket is in use by a wasm module. Scenario: the host creates a tcp listener socket bound to an address, and adds it to Sometime later, while wasm module is still waiting on What is the recommended method of closing a socket in this scenario? |
@stevelr shutdown doesn't do a close; it just marks a stream as no longer readable, writeable, or both. The file descriptor remains open. And it isn't required to be called. The main use case for it that I know is for one side of a socket to declare that it's done writing to a stream and will subsequently only be reading the response. |
The original WASI specification included
sock_read
,sock_write
, andshutdown
. Now that we have some sockets support, implement theseadditional functions, to make it easier for people porting existing code
to WASI.
It's expected that this will all be subsumed by the wasi-sockets
proposal, but for now, this is a relatively small change which should
hopefully unblock people trying to use the current
accept
support.