@@ -343,7 +343,9 @@ used when using `dgram.Socket` objects with the [`cluster`][] module. When
343
343
` exclusive ` is set to ` false ` (the default), cluster workers will use the same
344
344
underlying socket handle allowing connection handling duties to be shared.
345
345
When ` exclusive ` is ` true ` , however, the handle is not shared and attempted
346
- port sharing results in an error.
346
+ port sharing results in an error. Creating a ` dgram.Socket ` with the ` reusePort `
347
+ option set to ` true ` causes ` exclusive ` to always be ` true ` when ` socket.bind() `
348
+ is called.
347
349
348
350
A bound datagram socket keeps the Node.js process running to receive
349
351
datagram messages.
@@ -916,6 +918,9 @@ chained.
916
918
<!-- YAML
917
919
added: v0.11.13
918
920
changes:
921
+ - version: REPLACEME
922
+ pr-url: https://github.com/nodejs/node/pull/55403
923
+ description: The `reusePort` option is supported.
919
924
- version: v15.8.0
920
925
pr-url: https://github.com/nodejs/node/pull/37026
921
926
description: AbortSignal support was added.
@@ -935,7 +940,15 @@ changes:
935
940
* ` type ` {string} The family of socket. Must be either ` 'udp4' ` or ` 'udp6' ` .
936
941
Required.
937
942
* ` reuseAddr ` {boolean} When ` true ` [ ` socket.bind() ` ] [ ] will reuse the
938
- address, even if another process has already bound a socket on it.
943
+ address, even if another process has already bound a socket on it, but
944
+ only one socket can receive the data.
945
+ ** Default:** ` false ` .
946
+ * ` reusePort ` {boolean} When ` true ` [ ` socket.bind() ` ] [ ] will reuse the
947
+ port, even if another process has already bound a socket on it. Incoming
948
+ datagrams are distributed to listening sockets. The option is available
949
+ only on some platforms, such as Linux 3.9+, DragonFlyBSD 3.6+, FreeBSD 12.0+,
950
+ Solaris 11.4, and AIX 7.2.5+. On unsupported platforms this option raises an
951
+ an error when the socket is bound.
939
952
** Default:** ` false ` .
940
953
* ` ipv6Only ` {boolean} Setting ` ipv6Only ` to ` true ` will
941
954
disable dual-stack support, i.e., binding to address ` :: ` won't make
0 commit comments