diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2022-04-22 01:31:09 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2022-04-28 07:57:21 +0300 |
commit | d9f3f05cabecfeff7c267b9193f21b71013679b0 (patch) | |
tree | 704edb957962f0864a52982e4a698bbac63ef274 /doc | |
parent | 6fa080cb4874f4a459b862c81bca3132ad042e67 (diff) |
doc: fix outdated documentation for `family` property
Refs: https://github.com/nodejs/node/pull/41431
Fixes: https://github.com/nodejs/node/issues/42787
PR-URL: https://github.com/nodejs/node/pull/42789
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/dgram.md | 6 | ||||
-rw-r--r-- | doc/api/net.md | 14 | ||||
-rw-r--r-- | doc/api/os.md | 16 | ||||
-rw-r--r-- | doc/api/tls.md | 6 |
4 files changed, 31 insertions, 11 deletions
diff --git a/doc/api/dgram.md b/doc/api/dgram.md index f9e9b6b8745..185c5f60e9a 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -113,6 +113,10 @@ exist and calls such as `socket.address()` and `socket.setTTL()` will fail. <!-- YAML added: v0.1.99 +changes: + - version: v18.0.0 + pr-url: https://github.com/nodejs/node/pull/41431 + description: The `family` property now returns a number instead of a string. --> The `'message'` event is emitted when a new datagram is available on a socket. @@ -121,7 +125,7 @@ The event handler function is passed two arguments: `msg` and `rinfo`. * `msg` {Buffer} The message. * `rinfo` {Object} Remote address information. * `address` {string} The sender address. - * `family` {string} The address family (`'IPv4'` or `'IPv6'`). + * `family` {number} The address family (`4` for IPv4 or `6` for IPv6). * `port` {number} The sender port. * `size` {number} The message size. diff --git a/doc/api/net.md b/doc/api/net.md index 9bf34d55086..39d7cbdac53 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -285,6 +285,10 @@ Emitted when the server has been bound after calling [`server.listen()`][]. <!-- YAML added: v0.1.90 +changes: + - version: v18.0.0 + pr-url: https://github.com/nodejs/node/pull/41431 + description: The `family` property now returns a number instead of a string. --> * Returns: {Object|string|null} @@ -292,7 +296,7 @@ added: v0.1.90 Returns the bound `address`, the address `family` name, and `port` of the server as reported by the operating system if listening on an IP socket (useful to find which port was assigned when getting an OS-assigned address): -`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. +`{ port: 12346, family: 4, address: '127.0.0.1' }`. For a server listening on a pipe or Unix domain socket, the name is returned as a string. @@ -710,7 +714,7 @@ Not applicable to Unix sockets. * `err` {Error|null} The error object. See [`dns.lookup()`][]. * `address` {string} The IP address. -* `family` {string|null} The address type. See [`dns.lookup()`][]. +* `family` {number|null} The address type. See [`dns.lookup()`][]. * `host` {string} The host name. ### Event: `'ready'` @@ -738,13 +742,17 @@ See also: [`socket.setTimeout()`][]. <!-- YAML added: v0.1.90 +changes: + - version: v18.0.0 + pr-url: https://github.com/nodejs/node/pull/41431 + description: The `family` property now returns a number instead of a string. --> * Returns: {Object} Returns the bound `address`, the address `family` name and `port` of the socket as reported by the operating system: -`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` +`{ port: 12346, family: 4, address: '127.0.0.1' }` ### `socket.bufferSize` diff --git a/doc/api/os.md b/doc/api/os.md index d0bef604d96..ad4d082d94d 100644 --- a/doc/api/os.md +++ b/doc/api/os.md @@ -224,6 +224,10 @@ always `[0, 0, 0]`. <!-- YAML added: v0.6.0 +changes: + - version: v18.0.0 + pr-url: https://github.com/nodejs/node/pull/41431 + description: The `family` property now returns a number instead of a string. --> * Returns: {Object} @@ -238,12 +242,12 @@ The properties available on the assigned network address object include: * `address` {string} The assigned IPv4 or IPv6 address * `netmask` {string} The IPv4 or IPv6 network mask -* `family` {string} Either `IPv4` or `IPv6` +* `family` {number} Either `4` (for IPv4) or `6` (for IPv6) * `mac` {string} The MAC address of the network interface * `internal` {boolean} `true` if the network interface is a loopback or similar interface that is not remotely accessible; otherwise `false` * `scopeid` {number} The numeric IPv6 scope ID (only specified when `family` - is `IPv6`) + is `6`) * `cidr` {string} The assigned IPv4 or IPv6 address with the routing prefix in CIDR notation. If the `netmask` is invalid, this property is set to `null`. @@ -256,7 +260,7 @@ The properties available on the assigned network address object include: { address: '127.0.0.1', netmask: '255.0.0.0', - family: 'IPv4', + family: 4, mac: '00:00:00:00:00:00', internal: true, cidr: '127.0.0.1/8' @@ -264,7 +268,7 @@ The properties available on the assigned network address object include: { address: '::1', netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - family: 'IPv6', + family: 6, mac: '00:00:00:00:00:00', scopeid: 0, internal: true, @@ -275,7 +279,7 @@ The properties available on the assigned network address object include: { address: '192.168.1.108', netmask: '255.255.255.0', - family: 'IPv4', + family: 4, mac: '01:02:03:0a:0b:0c', internal: false, cidr: '192.168.1.108/24' @@ -283,7 +287,7 @@ The properties available on the assigned network address object include: { address: 'fe80::a00:27ff:fe4e:66a1', netmask: 'ffff:ffff:ffff:ffff::', - family: 'IPv6', + family: 6, mac: '01:02:03:0a:0b:0c', scopeid: 1, internal: false, diff --git a/doc/api/tls.md b/doc/api/tls.md index 52e0e71f1e0..5c91de3fd93 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -955,13 +955,17 @@ tlsSocket.once('session', (session) => { <!-- YAML added: v0.11.4 +changes: + - version: v18.0.0 + pr-url: https://github.com/nodejs/node/pull/41431 + description: The `family` property now returns a number instead of a string. --> * Returns: {Object} Returns the bound `address`, the address `family` name, and `port` of the underlying socket as reported by the operating system: -`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. +`{ port: 12346, family: 4, address: '127.0.0.1' }`. ### `tlsSocket.authorizationError` |