Closed nikneym closed 1 year ago
you need to explicitly enable network. the --enable-all
is there to enable WASI features, not network.
So try with
wasmer run --enable-all --net -a 127.0.0.1:8080 zig-out/bin/wasix-test.wasm
you need to explicitly enable network. the
--enable-all
is there to enable WASI features, not network. So try withwasmer run --enable-all --net -a 127.0.0.1:8080 zig-out/bin/wasix-test.wasm
Tried as you've claimed, I still get INVAL
:
zig build -Dtarget=wasm32-wasi
wasmer run --enable-all --net -a 127.0.0.1:8080 zig-out/bin/wasix-test.wasm
Turns out in order to create valid TCP/IP socket, address family must be INET4
which is 1. I thought AF_INET
(which is 2) is required for creating such socket. All is well now, sorry for the heads up!
Summary
Hi, I'm trying to use WASIX calls through Zig and currently unable to bind my socket to a local address. You can find the implementation here and my main function here. A call to
sock_bind
always results withINVAL
(sock_connect
just works fine by the way). I've compared my declarations with wasix-libc but couldn't spot the issue.In order to build & run the project I'm running these: