Skip to content

Commit 6b32877

Browse files
HarshithaKPtargos
authored andcommitted
doc: clarify listening event
Co-authored-by: Divyanshu <[email protected]> PR-URL: #32581 Reviewed-By: Anna Henningsen <[email protected]>
1 parent 246b789 commit 6b32877

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doc/api/dgram.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ function is passed a single `Error` object.
7373
added: v0.1.99
7474
-->
7575

76-
The `'listening'` event is emitted whenever a socket begins listening for
77-
datagram messages. This occurs as soon as UDP sockets are created.
76+
The `'listening'` event is emitted once the `dgram.Socket` is addressable and
77+
can receive data. This happens either explicitly with `socket.bind()` or
78+
implicitly the first time data is sent using `socket.send()`.
79+
Until the `dgram.Socket` is listening, the underlying system resources do not
80+
exist and calls such as `socket.address()` and `socket.setTTL()` will fail.
7881

7982
### Event: `'message'`
8083
<!-- YAML

0 commit comments

Comments
 (0)