Skip to content

Commit d9f3f05

Browse files
aduh95targos
authored andcommitted
doc: fix outdated documentation for family property
Refs: #41431 Fixes: #42787 PR-URL: #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>
1 parent 6fa080c commit d9f3f05

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

doc/api/dgram.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ exist and calls such as `socket.address()` and `socket.setTTL()` will fail.
113113

114114
<!-- YAML
115115
added: v0.1.99
116+
changes:
117+
- version: v18.0.0
118+
pr-url: https://github.com/nodejs/node/pull/41431
119+
description: The `family` property now returns a number instead of a string.
116120
-->
117121

118122
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`.
121125
* `msg` {Buffer} The message.
122126
* `rinfo` {Object} Remote address information.
123127
* `address` {string} The sender address.
124-
* `family` {string} The address family (`'IPv4'` or `'IPv6'`).
128+
* `family` {number} The address family (`4` for IPv4 or `6` for IPv6).
125129
* `port` {number} The sender port.
126130
* `size` {number} The message size.
127131

doc/api/net.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,18 @@ Emitted when the server has been bound after calling [`server.listen()`][].
285285

286286
<!-- YAML
287287
added: v0.1.90
288+
changes:
289+
- version: v18.0.0
290+
pr-url: https://github.com/nodejs/node/pull/41431
291+
description: The `family` property now returns a number instead of a string.
288292
-->
289293

290294
* Returns: {Object|string|null}
291295

292296
Returns the bound `address`, the address `family` name, and `port` of the server
293297
as reported by the operating system if listening on an IP socket
294298
(useful to find which port was assigned when getting an OS-assigned address):
295-
`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`.
299+
`{ port: 12346, family: 4, address: '127.0.0.1' }`.
296300

297301
For a server listening on a pipe or Unix domain socket, the name is returned
298302
as a string.
@@ -710,7 +714,7 @@ Not applicable to Unix sockets.
710714

711715
* `err` {Error|null} The error object. See [`dns.lookup()`][].
712716
* `address` {string} The IP address.
713-
* `family` {string|null} The address type. See [`dns.lookup()`][].
717+
* `family` {number|null} The address type. See [`dns.lookup()`][].
714718
* `host` {string} The host name.
715719

716720
### Event: `'ready'`
@@ -738,13 +742,17 @@ See also: [`socket.setTimeout()`][].
738742

739743
<!-- YAML
740744
added: v0.1.90
745+
changes:
746+
- version: v18.0.0
747+
pr-url: https://github.com/nodejs/node/pull/41431
748+
description: The `family` property now returns a number instead of a string.
741749
-->
742750

743751
* Returns: {Object}
744752

745753
Returns the bound `address`, the address `family` name and `port` of the
746754
socket as reported by the operating system:
747-
`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`
755+
`{ port: 12346, family: 4, address: '127.0.0.1' }`
748756

749757
### `socket.bufferSize`
750758

doc/api/os.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ always `[0, 0, 0]`.
224224

225225
<!-- YAML
226226
added: v0.6.0
227+
changes:
228+
- version: v18.0.0
229+
pr-url: https://github.com/nodejs/node/pull/41431
230+
description: The `family` property now returns a number instead of a string.
227231
-->
228232

229233
* Returns: {Object}
@@ -238,12 +242,12 @@ The properties available on the assigned network address object include:
238242

239243
* `address` {string} The assigned IPv4 or IPv6 address
240244
* `netmask` {string} The IPv4 or IPv6 network mask
241-
* `family` {string} Either `IPv4` or `IPv6`
245+
* `family` {number} Either `4` (for IPv4) or `6` (for IPv6)
242246
* `mac` {string} The MAC address of the network interface
243247
* `internal` {boolean} `true` if the network interface is a loopback or
244248
similar interface that is not remotely accessible; otherwise `false`
245249
* `scopeid` {number} The numeric IPv6 scope ID (only specified when `family`
246-
is `IPv6`)
250+
is `6`)
247251
* `cidr` {string} The assigned IPv4 or IPv6 address with the routing prefix
248252
in CIDR notation. If the `netmask` is invalid, this property is set
249253
to `null`.
@@ -256,15 +260,15 @@ The properties available on the assigned network address object include:
256260
{
257261
address: '127.0.0.1',
258262
netmask: '255.0.0.0',
259-
family: 'IPv4',
263+
family: 4,
260264
mac: '00:00:00:00:00:00',
261265
internal: true,
262266
cidr: '127.0.0.1/8'
263267
},
264268
{
265269
address: '::1',
266270
netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
267-
family: 'IPv6',
271+
family: 6,
268272
mac: '00:00:00:00:00:00',
269273
scopeid: 0,
270274
internal: true,
@@ -275,15 +279,15 @@ The properties available on the assigned network address object include:
275279
{
276280
address: '192.168.1.108',
277281
netmask: '255.255.255.0',
278-
family: 'IPv4',
282+
family: 4,
279283
mac: '01:02:03:0a:0b:0c',
280284
internal: false,
281285
cidr: '192.168.1.108/24'
282286
},
283287
{
284288
address: 'fe80::a00:27ff:fe4e:66a1',
285289
netmask: 'ffff:ffff:ffff:ffff::',
286-
family: 'IPv6',
290+
family: 6,
287291
mac: '01:02:03:0a:0b:0c',
288292
scopeid: 1,
289293
internal: false,

doc/api/tls.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -955,13 +955,17 @@ tlsSocket.once('session', (session) => {
955955

956956
<!-- YAML
957957
added: v0.11.4
958+
changes:
959+
- version: v18.0.0
960+
pr-url: https://github.com/nodejs/node/pull/41431
961+
description: The `family` property now returns a number instead of a string.
958962
-->
959963

960964
* Returns: {Object}
961965

962966
Returns the bound `address`, the address `family` name, and `port` of the
963967
underlying socket as reported by the operating system:
964-
`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`.
968+
`{ port: 12346, family: 4, address: '127.0.0.1' }`.
965969

966970
### `tlsSocket.authorizationError`
967971

0 commit comments

Comments
 (0)