Skip to content
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

Does wasmtime support socket? #2732

Closed
ZW007 opened this issue Mar 16, 2021 · 2 comments
Closed

Does wasmtime support socket? #2732

ZW007 opened this issue Mar 16, 2021 · 2 comments

Comments

@ZW007
Copy link

ZW007 commented Mar 16, 2021

I have a socket cpp application, i want to port it to wasm, so i did:
wasm32-wasi-clang++ server_c1.cpp -o server_c1Wasi.wasm
but it says

server_c1.cpp:28:21: error: use of undeclared identifier 'socket'
int serv_sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);

I wonder if there is any workaround? Thank you!

@bjorn3
Copy link
Contributor

bjorn3 commented Mar 16, 2021

No, wasi doesn't have any networking capabilities yet. cc WebAssembly/WASI#370 and WebAssembly/WASI#312

@alexcrichton
Copy link
Member

I'm going to close this in favor of upstream WASI proposals to add sockets. Of note is that sock_accept was recently added to wasi-snapshot-preview1 which Wasmtime supports now as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants