Wasm Directoryalpha
Resource

resolve-address-stream

No description available.

resource resolve-address-stream;

F resolve-next-address

resolve-next-address: func() -> result​<option​<ip-address>, error-code>;

Returns the next address from the resolver.

This function should be called multiple times. On each call, it will return the next address in connection order preference. If all addresses have been exhausted, this function returns none.

This function never returns IPv4-mapped IPv6 addresses.

Typical errors

  • name-unresolvable: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY)
  • temporary-resolver-failure: A temporary failure in name resolution occurred. (EAI_AGAIN)
  • permanent-resolver-failure: A permanent failure in name resolution occurred. (EAI_FAIL)
  • would-block: A result is not available yet. (EWOULDBLOCK, EAGAIN)

F subscribe

subscribe: func() -> pollable;

Create a pollable which will resolve once the stream is ready for I/O.

Note: this function is here for WASI 0.2 only. It's planned to be removed when future is natively supported in Preview3.