GeezerVison is showing github.com — doc: clarify `listening` event · nodejs/node@d2c86a9
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/dgram.md +5-2Lines changed: 5 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -73,8 +73,11 @@ function is passed a single `Error` object. |
73 | 73 | added: v0.1.99 |
74 | 74 | --> |
75 | 75 |
|
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. |
78 | 81 |
|
79 | 82 | ### Event: `'message'` |
80 | 83 | <!-- YAML |
|