diff --git a/imports.md b/imports.md index 7555963..497f48d 100644 --- a/imports.md +++ b/imports.md @@ -2,19 +2,21 @@ -

Import interface wasi:sockets/network

+

Import interface wasi:sockets/network@0.2.0-rc-2023-11-10


Types

resource network

@@ -28,6 +30,7 @@ combined with a couple of errors that are always possible:

  • access-denied
  • not-supported
  • out-of-memory
  • +
  • concurrency-conflict
  • See each individual API for what the POSIX equivalents are. They sometimes differ per API.

    Enum Cases
    @@ -47,6 +50,11 @@ combined with a couple of errors that are always possible:

    POSIX equivalent: EOPNOTSUPP

  • +

    invalid-argument

    +

    One of the arguments is invalid. +

    POSIX equivalent: EINVAL

    +
  • +
  • out-of-memory

    Not enough memory to complete the operation.

    POSIX equivalent: ENOMEM, ENOBUFS, EAI_MEMORY

    @@ -58,6 +66,7 @@ combined with a couple of errors that are always possible:

  • concurrency-conflict

    This operation is incompatible with another asynchronous operation that is already in progress. +

    POSIX equivalent: EALREADY

  • not-in-progress

    @@ -72,74 +81,26 @@ combined with a couple of errors that are always possible:

    Note: this is scheduled to be removed when futures are natively supported.

  • -

    address-family-not-supported

    -

    The specified address-family is not supported. -

  • -
  • -

    address-family-mismatch

    -

    An IPv4 address was passed to an IPv6 resource, or vice versa. -

  • -
  • -

    invalid-remote-address

    -

    The socket address is not a valid remote address. E.g. the IP address is set to INADDR_ANY, or the port is set to 0. -

  • -
  • -

    ipv4-only-operation

    -

    The operation is only supported on IPv4 resources. -

  • -
  • -

    ipv6-only-operation

    -

    The operation is only supported on IPv6 resources. +

    invalid-state

    +

    The operation is not valid in the socket's current state.

  • new-socket-limit

    A new socket resource could not be created because of a system limit.

  • -

    already-attached

    -

    The socket is already attached to another network. -

  • -
  • -

    already-bound

    -

    The socket is already bound. -

  • -
  • -

    already-connected

    -

    The socket is already in the Connection state. -

  • -
  • -

    not-bound

    -

    The socket is not bound to any local address. -

  • -
  • -

    not-connected

    -

    The socket is not in the Connection state. -

  • -
  • address-not-bindable

    A bind operation failed because the provided address is not an address that the `network` can bind to.

  • address-in-use

    -

    A bind operation failed because the provided address is already in use. -

  • -
  • -

    ephemeral-ports-exhausted

    -

    A bind operation failed because there are no ephemeral ports available. +

    A bind operation failed because the provided address is already in use or because there are no ephemeral ports available.

  • remote-unreachable

    The remote address is not reachable

  • -

    already-listening

    -

    The socket is already in the Listener state. -

  • -
  • -

    not-listening

    -

    The socket is already in the Listener state. -

  • -
  • connection-refused

    The connection was forcefully rejected

  • @@ -148,11 +109,11 @@ combined with a couple of errors that are always possible:

    The connection was reset.

  • -

    datagram-too-large

    +

    connection-aborted

    +

    A connection was aborted.

  • -

    invalid-name

    -

    The provided name is a syntactically invalid domain name. +

    datagram-too-large

  • name-unresolvable

    @@ -225,7 +186,7 @@ combined with a couple of errors that are always possible:

  • ipv4: ipv4-socket-address
  • ipv6: ipv6-socket-address
  • -

    Import interface wasi:sockets/instance-network

    +

    Import interface wasi:sockets/instance-network@0.2.0-rc-2023-11-10

    This interface provides a value-export of the default network handle..


    Types

    @@ -240,7 +201,7 @@ combined with a couple of errors that are always possible:

    -

    Import interface wasi:io/poll

    +

    Import interface wasi:io/poll@0.2.0-rc-2023-11-10

    A poll API intended to let users wait for I/O events on multiple handles at once.


    @@ -290,7 +251,7 @@ being reaedy for I/O.

    -

    Import interface wasi:sockets/udp

    +

    Import interface wasi:sockets/udp@0.2.0-rc-2023-11-10


    Types

    type pollable

    @@ -308,31 +269,60 @@ being reaedy for I/O.

    #### `type ip-address-family` [`ip-address-family`](#ip_address_family)

    -#### `record datagram` +#### `record incoming-datagram` +

    A received datagram.

    +
    Record Fields
    + +

    record outgoing-datagram

    +

    A datagram to be sent out.

    Record Fields

    resource udp-socket

    +

    resource incoming-datagram-stream

    +

    resource outgoing-datagram-stream


    Functions

    [method]udp-socket.start-bind: func

    Bind the socket to a specific network on the provided IP address and port.

    If the IP address is zero (0.0.0.0 in IPv4, :: in IPv6), it is left to the implementation to decide which network interface(s) to bind to. -If the TCP/UDP port is zero, the socket will be bound to a random free port.

    -

    When a socket is not explicitly bound, the first invocation to connect will implicitly bind the socket.

    +If the port is zero, the socket will be bound to a random free port.

    Unlike in POSIX, this function is async. This enables interactive WASI hosts to inject permission prompts.

    Typical start errors

    Typical finish errors