Replies: 1 comment
-
First of all, in order to use
Yes, looks like these imports are not recognized correctly with your WebAssembly environment, perhaps TeaVM has nothing to do with this (unless it's generating some broken wasm file, which, perhaps, is not the case). So you should further investigate why your environment does not export these functions. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to add WebAssembly networking support to a Java project using TeaVM. TeaVM does support importing WASI functions, as demonstrated in the
Wasi.java
class, which successfully imports functions likeclock_time_get
andfd_read
using@Import
.However, when I try to use a similar mechanism in my custom
WasiSocket
class to import additional WASI networking functions, such assock_accept
andsock_addr_local
, I encounter issues. Here’s theWasiSocket
class:When I try to run the WebAssembly module generated by TeaVM in Wasmtime or in a browser environment, I get the following error:
This suggests that my imports for WASI networking functions are not being recognized correctly, even though a similar approach works for other WASI functions in
Wasi.java
.Here’s my setup:
How can I make these additional WASI networking imports work in TeaVM? Are there specific configurations, limitations, or adjustments required for importing extra WASI functions in TeaVM?
Beta Was this translation helpful? Give feedback.
All reactions