diff options
author | Harshitha KP <harshi46@in.ibm.com> | 2020-03-31 14:10:26 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-04-07 21:31:40 +0300 |
commit | 8c12a08de56dde4e31f68c0a6944379dd8206dc8 (patch) | |
tree | 82ba57545c7e9192b2c2a806fbf0566f0e215661 /doc/api/dgram.md | |
parent | f4dfbeb12d8f144f7ab5e5caa22ee70ce5e9eabe (diff) |
doc: clarify `listening` event
Co-authored-by: Divyanshu <dsinecos@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/32581
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'doc/api/dgram.md')
-rw-r--r-- | doc/api/dgram.md | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/api/dgram.md b/doc/api/dgram.md index d3eee26cdd5..57a38e3895f 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -73,8 +73,11 @@ function is passed a single `Error` object. added: v0.1.99 --> -The `'listening'` event is emitted whenever a socket begins listening for -datagram messages. This occurs as soon as UDP sockets are created. +The `'listening'` event is emitted once the `dgram.Socket` is addressable and +can receive data. This happens either explicitly with `socket.bind()` or +implicitly the first time data is sent using `socket.send()`. +Until the `dgram.Socket` is listening, the underlying system resources do not +exist and calls such as `socket.address()` and `socket.setTTL()` will fail. ### Event: `'message'` <!-- YAML |