WASI icon indicating copy to clipboard operation
WASI copied to clipboard

Clarify the implicit bind behavior observed on Windows.

Open badeend opened this issue 1 week ago • 0 comments

The documentation of tcp-socket::listen mentions:

If the socket is not already explicitly bound, this function will implicitly bind the socket to a random free port.

I've recently added tests for this in wasmtime. The tests ran fine on Linux and MacOS but failed on Windows. Apparently, Windows does not perform an implicit bind as part of listen. I've updated wasmtime to perform the bind explicitly if the guest hasn't already done so. This makes it behave the same on all platforms.

This PR adds a note on listen clarifying the expected WASI behavior and observed OS behavior.

badeend avatar Jan 10 '26 10:01 badeend