WasmEdge icon indicating copy to clipboard operation
WasmEdge copied to clipboard

feat: WASI-Socket: Handle IPv4, IPv6, and more protocols

Open hydai opened this issue 3 years ago • 1 comments

Motivation

In the current design of the WASI socket, we use sockaddr_in and sockaddr_in6 to handle the IPv4 and IPv6. However, it's a big problem to deal with the structure size in WASM memory. The sockaddr_in uses 16 bytes whereas sockaddr_in6 uses 28 bytes.

To simply the situation and increase the compatibility, using sockaddr_storage as the new interface type is a better way.

Details

To enable this feature, there are several things need to do:

  1. Handle the conversion between sockaddr_storage and sockaddr_in | sockaddr_in6 in the host function implementation details.
  2. Define the corresponding data structure on Rust Crates Side.

hydai avatar May 26 '22 06:05 hydai

UP UP UP UP UP

sascha1337 avatar May 27 '22 20:05 sascha1337

Can be replaced by #2939

dannypsnl avatar Mar 04 '24 09:03 dannypsnl