Skip to content

Commit

Permalink
doc: clarify listening event
Browse files Browse the repository at this point in the history
Co-authored-by: Divyanshu <dsinecos@gmail.com>

PR-URL: #32581
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
HarshithaKP authored and targos committed Apr 11, 2020
1 parent 246b789 commit 6b32877
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doc/api/dgram.md
Expand Up @@ -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
Expand Down

0 comments on commit 6b32877

Please sign in to comment.