Adds another static address to the local port.
port_addr_add() function is used to add an additional static address to the local port. This allows the port to listen on multiple IP addresses.
;;; Adds another static address to the local port (@interface func (export "port_addr_add") ;;; Address to be added (param $addr (@witx const_pointer $addr_cidr)) (result $error (expected (error $errno))) )
ctx: A mutable reference to the function environment.
ip: A WebAssembly pointer to a
__wasi_cidr_tstructure that represents the IP address and prefix length of the address to be added.
The function returns a
Result indicating the outcome of the operation. If the operation is successful,
Ok(Errno::Success) is returned. If an error occurs, an appropriate
WasiError is returned.
port_addr_add()function adds another static address to the local port, allowing the port to listen on multiple IP addresses.
__wasi_cidr_tstructure represents an IP address and prefix length. It contains two fields:
ipfor the IP address and
prefixfor the prefix length.
- The behavior and limitations of the
port_addr_add()function may vary depending on the specific runtime environment and underlying networking implementation. It is important to consult the documentation or specifications of the specific environment to understand its behavior in that context.