diff options
author | Bartosz Sosnowski <bartosz@janeasystems.com> | 2017-12-28 10:42:11 +0100 |
---|---|---|
committer | Bartosz Sosnowski <bartosz@janeasystems.com> | 2017-12-28 10:42:11 +0100 |
commit | 2b32e77bb6f41e2786168ec0f32d1f0fcc78071b (patch) | |
tree | d4c31e3bfb10ca0192ad2e149f81a100ef37d109 /docs/src | |
parent | cde132631b5da7368e7fb0d62d7b9e3b30e81a83 (diff) | |
download | libuv-2b32e77bb6f41e2786168ec0f32d1f0fcc78071b.tar.gz libuv-2b32e77bb6f41e2786168ec0f32d1f0fcc78071b.zip |
win: map 0.0.0.0 and :: addresses to localhost
On Linux when connecting IP addresses 0.0.0.0 and :: are automatically
converted to localhost. This adds same functionality to Windows.
PR-URL: https://github.com/libuv/libuv/pull/1515
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/tcp.rst | 7 | ||||
-rw-r--r-- | docs/src/udp.rst | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/src/tcp.rst b/docs/src/tcp.rst index a1a58245..e761b460 100644 --- a/docs/src/tcp.rst +++ b/docs/src/tcp.rst @@ -102,7 +102,14 @@ API and an uninitialized :c:type:`uv_connect_t`. `addr` should point to an initialized ``struct sockaddr_in`` or ``struct sockaddr_in6``. + On Windows if the `addr` is initialized to point to an unspecified address + (``0.0.0.0`` or ``::``) it will be changed to point to ``localhost``. + This is done to match the behavior of Linux systems. + The callback is made when the connection has been established or when a connection error happened. + .. versionchanged:: 1.19.0 added ``0.0.0.0`` and ``::`` to ``localhost`` + mapping + .. seealso:: The :c:type:`uv_stream_t` API functions also apply. diff --git a/docs/src/udp.rst b/docs/src/udp.rst index 8704a099..81488285 100644 --- a/docs/src/udp.rst +++ b/docs/src/udp.rst @@ -243,6 +243,10 @@ API with :c:func:`uv_udp_bind` it will be bound to 0.0.0.0 (the "all interfaces" IPv4 address) and a random port number. + On Windows if the `addr` is initialized to point to an unspecified address + (``0.0.0.0`` or ``::``) it will be changed to point to ``localhost``. + This is done to match the behavior of Linux systems. + :param req: UDP request handle. Need not be initialized. :param handle: UDP handle. Should have been initialized with @@ -259,6 +263,9 @@ API :returns: 0 on success, or an error code < 0 on failure. + .. versionchanged:: 1.19.0 added ``0.0.0.0`` and ``::`` to ``localhost`` + mapping + .. c:function:: int uv_udp_try_send(uv_udp_t* handle, const uv_buf_t bufs[], unsigned int nbufs, const struct sockaddr* addr) Same as :c:func:`uv_udp_send`, but won't queue a send request if it can't |