diff --git a/doc/api/dgram.md b/doc/api/dgram.md index db93e1f2089916..8e8f06551b7dac 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -108,6 +108,9 @@ Tells the kernel to join a multicast group at the given `multicastAddress` and one interface and will add membership to it. To add membership to every available interface, call `addMembership` multiple times, once per interface. +When called on an unbound socket, this method will implicitly bind to a random +port, listening on all interfaces. + When sharing a UDP socket across multiple `cluster` workers, the `socket.addMembership()` function must be called only once or an `EADDRINUSE` error will occur: @@ -143,6 +146,9 @@ is not specified, the operating system will choose one interface and will add membership to it. To add membership to every available interface, call `socket.addSourceSpecificMembership()` multiple times, once per interface. +When called on an unbound socket, this method will implicitly bind to a random +port, listening on all interfaces. + ### `socket.address()` A synchronous function that disassociates a connected `dgram.Socket` from -its remote address. Trying to call `disconnect()` on an already disconnected -socket will result in an [`ERR_SOCKET_DGRAM_NOT_CONNECTED`][] exception. +its remote address. Trying to call `disconnect()` on an unbound or already +disconnected socket will result in an [`ERR_SOCKET_DGRAM_NOT_CONNECTED`][] +exception. ### `socket.dropMembership(multicastAddress[, multicastInterface])`