Skip to content

Commit 7794c13

Browse files
docs: document dgram.send callback behavior
1 parent c2b540a commit 7794c13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

doc/api/dgram.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ assigned a random port number and is bound to the "all interfaces" address
100100
An optional callback may be specified to detect DNS errors or for determining
101101
when it's safe to reuse the `buf` object. Note that DNS lookups delay the time
102102
to send for at least one tick. The only way to know for sure that the datagram
103-
has been sent is by using a callback.
103+
has been sent is by using a callback. If an error occurs and a callback is given,
104+
the error will be the first argument to the callback. If a callback is not given,
105+
the error is emitted as an `'error'` event on the `socket` object.
104106

105107
With consideration for multi-byte characters, `offset` and `length` will
106108
be calculated with respect to

0 commit comments

Comments
 (0)