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 DetailsThis 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 |
|
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
acceptsupport.