Open achille-roussel opened 1 year ago
You are right! The documentation is misleading in this case. I will correct it shortly. Here is the issue we have to track integrating WasmEdge sockets with CPython - https://github.com/vmware-labs/webassembly-language-runtimes/issues/70
The reason we have a separate build is purely for the sake of the sock_accept
method which has different signature in wasi_preview_1
and with WasmEdge.
Thanks a lot for pointing this out!
@achille-roussel , on a side note - is socket support in Python something for which you have some immediate business need , or are you just experimenting?
Asking to help us prioritize. Thanks!
I'm exploring what currently exists in the industry for networking with WASI. The use case is implementing it in Go, and I would like to stay as close to something that already exists for interoperability between languages and runtimes.
Based on this comment it appears that wasmedge corrected their implementation of sock_accept
in v0.12+ https://github.com/WasmEdge/WasmEdge/blob/master/lib/host/wasi/wasimodule.cpp#L64-L73 Maybe you won't need to ship a different build in the future :)
// To make the socket API compatible with the old one,
// we will duplicate all the API to V1 and V2.
// The V1 presents the original behavior before 0.12 release.
// On the other hand, the V2 presents the new behavior including
// the sock_accept is following the WASI spec, some of the API
// use a larger size for handling complex address type, e.g.
// AF_UNIX.
// By default, we will register V1 first, if the signatures are
// not the same as the wasm application imported, then V2 will
// replace instead.
Describe the bug
When importing the
socket
package, the program hangs and may only be interrupted by termination via a signal.Reproduction steps
Expected behavior
The documentation appears to say that networking with Python is possible when using the build leveraging the WasmEdge socket API extensions. I expected to be able to import the
socket
package and either create a TCP client or server.Additional context
No response