diff --git a/Posix-compatibility.md b/Posix-compatibility.md
index 26dfa2c..ae8853a 100644
--- a/Posix-compatibility.md
+++ b/Posix-compatibility.md
@@ -139,6 +139,7 @@ Additionally, most columns have been populated semi-automatically by grepping th
Legend:
- ✅ = Included in proposal.
+- ⚠️ = Partially supported.
- ⛔ = Consciously decided _not_ to include in WASI. See notes for explanation.
- ❔ = Not included (yet), for no particular reason.
@@ -147,7 +148,6 @@ Legend:
|----| ---------------------------------|-----------------------------------------|---------------------|
| ✅ | SO_DOMAIN
SO_PROTOCOL_INFO on Windows | [`tcp-socket::address-family`][tcp]
[`udp-socket::address-family`][udp] | linux, windows, freebsd, .net |
| ✅ | SO_ACCEPTCONN | [`tcp-socket::is-listening`][tcp] | posix, linux, windows, macos, freebsd, .net |
-| ✅ | IPV6_V6ONLY | [`tcp-socket::(set-)ipv6-only`][tcp]
[`udp-socket::(set-)ipv6-only`][udp] | posix, linux, windows, macos, freebsd, jvm, .net, libuv, go, openssl, curl, msquic, exim |
| ✅ | IP_TTL | [`tcp-socket::(set-)hop-limit`][tcp]
[`udp-socket::(set-)unicast-hop-limit`][udp] | linux, windows, macos, freebsd, jvm, .net, rust, libuv |
| ✅ | IPV6_UNICAST_HOPS | [`tcp-socket::(set-)hop-limit`][tcp]
[`udp-socket::(set-)unicast-hop-limit`][udp] | posix, linux, windows, macos, freebsd, jvm, .net, libuv |
| ✅ | SO_RCVBUF | [`tcp-socket::(set-)receive-buffer-size`][tcp]
[`udp-socket::(set-)receive-buffer-size`][udp] | posix, linux, windows, macos, freebsd, jvm, .net, libuv, go, nginx, msquic |
@@ -157,6 +157,7 @@ Legend:
| ✅ | TCP_KEEPINTVL | [`tcp-socket::(set-)keep-alive-interval`][tcp] | linux, windows, macos, freebsd, jvm, .net, libuv, go, nginx, curl |
| ✅ | TCP_KEEPCNT | [`tcp-socket::(set-)keep-alive-count`][tcp] | linux, windows, macos, freebsd, jvm, .net, libuv, nginx |
| ✅ | SO_REUSEADDR for TCP | Enabled by default. See [`tcp-socket::bind`][tcp] | posix, linux, windows, macos, freebsd, jvm, .net, libuv, go, openssl, nginx, curl, exim |
+| ⚠️ | IPV6_V6ONLY | In WASI this always `true`. [#1][1] | posix, linux, windows, macos, freebsd, jvm, .net, libuv, go, openssl, curl, msquic, exim |
| ⛔ | SO_ERROR | Not necessary. WIT has (or will have) native support for asynchronous results. | posix, linux, windows, macos, freebsd, jvm, .net, rust, libuv, go, openssl, nginx, curl, msquic |
| ⛔ | SO_TYPE | Can be inferred from the socket resource type. | posix, linux, windows, macos, freebsd, jvm, .net, go, openssl, nginx, curl, exim |
| ⛔ | SO_PROTOCOL
SO_PROTOCOL_INFO on Windows | Can be inferred from the socket resource type. | linux, windows, freebsd, .net, exim |
@@ -586,6 +587,7 @@ Legend:
| ❔ | TCP_USE_CMP_ACKS | | freebsd |
| ❔ | TCP_USER_LOG | | freebsd |
+[1]: https://github.com/WebAssembly/wasi-sockets/issues/1
[17]: https://github.com/WebAssembly/wasi-sockets/issues/17
[34]: https://github.com/WebAssembly/wasi-sockets/issues/34
[73]: https://github.com/WebAssembly/wasi-sockets/issues/73
diff --git a/imports.md b/imports.md
index 4cc6c2c..940ffef 100644
--- a/imports.md
+++ b/imports.md
@@ -403,7 +403,6 @@ if (remote_address is Some) {
invalid-argument
: The remote-address
has the wrong address family. (EAFNOSUPPORT)invalid-argument
: remote-address
is a non-IPv4-mapped IPv6 address, but the socket was bound to a specific IPv4-mapped IPv6 address. (or vice versa)invalid-argument
: The IP address in remote-address
is set to INADDR_ANY (0.0.0.0
/ ::
). (EDESTADDRREQ, EADDRNOTAVAIL)invalid-argument
: The port in remote-address
is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)invalid-state
: The socket is not bound.address
is unspecified.
-[method]udp-socket.ipv6-only: func
Whether IPv4 compatibility (dual-stack) mode is disabled or not.
-Equivalent to the IPV6_V6ONLY socket option.
-not-supported
: (get/set) this
socket is an IPv4 socket.invalid-state
: (set) The socket is already bound.not-supported
: (set) Host does not support dual-stack sockets. (Implementations are not required to.)self
: borrow<udp-socket
>bool
, error-code
>[method]udp-socket.set-ipv6-only: func
self
: borrow<udp-socket
>value
: bool
error-code
>[method]udp-socket.unicast-hop-limit: func
Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options.
If the provided value is 0, an invalid-argument
error is returned.
check-send
was not called or datagrams
contains
invalid-argument
: The remote-address
has the wrong address family. (EAFNOSUPPORT)invalid-argument
: remote-address
is a non-IPv4-mapped IPv6 address, but the socket was bound to a specific IPv4-mapped IPv6 address. (or vice versa)invalid-argument
: The IP address in remote-address
is set to INADDR_ANY (0.0.0.0
/ ::
). (EDESTADDRREQ, EADDRNOTAVAIL)invalid-argument
: The port in remote-address
is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)invalid-argument
: The socket is in "connected" mode and remote-address
is some
value that does not match the address passed to stream
. (EISCONN)future
is natively supported in Pre
create-udp-socket: func
Create a new UDP socket.
-Similar to socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)
in POSIX.
Similar to socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)
in POSIX.
+On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
This function does not require a network capability handle. This is considered to be safe because
at time of creation, the socket is not bound to any network
yet. Up to the moment bind
is called,
the socket is effectively an in-memory configuration object, unable to communicate with the outside world.
invalid-argument
: The local-address
has the wrong address family. (EAFNOSUPPORT, EFAULT on Windows)invalid-argument
: local-address
is not a unicast address. (EINVAL)invalid-argument
: local-address
is an IPv4-mapped IPv6 address, but the socket has ipv6-only
enabled. (EINVAL)invalid-argument
: local-address
is an IPv4-mapped IPv6 address. (EINVAL)invalid-state
: The socket is already bound. (EINVAL)finish
errorsdrop
, any method after such a failure may return an error.<
invalid-argument
: The remote-address
has the wrong address family. (EAFNOSUPPORT)invalid-argument
: remote-address
is not a unicast address. (EINVAL, ENETUNREACH on Linux, EAFNOSUPPORT on MacOS)invalid-argument
: remote-address
is an IPv4-mapped IPv6 address, but the socket has ipv6-only
enabled. (EINVAL, EADDRNOTAVAIL on Illumos)invalid-argument
: remote-address
is a non-IPv4-mapped IPv6 address, but the socket was bound to a specific IPv4-mapped IPv6 address. (or vice versa)invalid-argument
: remote-address
is an IPv4-mapped IPv6 address. (EINVAL, EADDRNOTAVAIL on Illumos)invalid-argument
: The IP address in remote-address
is set to INADDR_ANY (0.0.0.0
/ ::
). (EADDRNOTAVAIL on Windows)invalid-argument
: The port in remote-address
is set to 0. (EADDRNOTAVAIL on Windows)invalid-argument
: The socket is already attached to a different network. The network
passed to connect
must be identical to the one passed to bind
.drop
, any method after such a failure may return an error.<
The returned socket is bound and in the Connection state. The following properties are inherited from the listener socket:
address-family
ipv6-only
keep-alive-enabled
keep-alive-idle-time
keep-alive-interval
address
is unspecified.
-[method]tcp-socket.ipv6-only: func
Whether IPv4 compatibility (dual-stack) mode is disabled or not.
-Equivalent to the IPV6_V6ONLY socket option.
-invalid-state
: (set) The socket is already bound.not-supported
: (get/set) this
socket is an IPv4 socket.not-supported
: (set) Host does not support dual-stack sockets. (Implementations are not required to.)self
: borrow<tcp-socket
>bool
, error-code
>[method]tcp-socket.set-ipv6-only: func
self
: borrow<tcp-socket
>value
: bool
error-code
>[method]tcp-socket.set-listen-backlog-size: func
Hints the desired listen queue size. Implementations are free to ignore this.
If the provided value is 0, an invalid-argument
error is returned.
@@ -1787,7 +1730,8 @@ operations on the output-stream
associ
create-tcp-socket: func
Create a new TCP socket.
-Similar to socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)
in POSIX.
Similar to socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)
in POSIX.
+On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
This function does not require a network capability handle. This is considered to be safe because
at time of creation, the socket is not bound to any network
yet. Up to the moment bind
/listen
/connect
is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world.