summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMatteo Collina <hello@matteocollina.com>2015-05-26 09:17:00 +0200
committerRod Vagg <rod@vagg.org>2015-08-04 11:56:12 -0700
commitef2c8cd4ece424bf02048921b6709da411301c59 (patch)
tree866f683b40a68c6170c96d588b9cdecefe2b1ead /doc
parent3da057fef672da0d1f0173a2c8b4f64737917e19 (diff)
downloadandroid-node-v8-ef2c8cd4ece424bf02048921b6709da411301c59.tar.gz
android-node-v8-ef2c8cd4ece424bf02048921b6709da411301c59.tar.bz2
android-node-v8-ef2c8cd4ece424bf02048921b6709da411301c59.zip
dgram: make send cb act as "error" event handler
Modifies the dgram send() method to not emit errors when a DNS lookup fails if there is a callback. Given that the same UDP socket can be used to send messages to different hosts, the socket can be reused even if one of those send() fails. This slightly changes the behavior of a stable API, so that it behaves as users would expect to. This is based on https://github.com/joyent/node/pull/7738, which landed in 77266d7fadd8dfefb107ccb1e3fe97f9620f1288. Fixes: https://github.com/joyent/node/issues/4846 Refs: https://github.com/joyent/node/pull/7738 PR-URL: https://github.com/nodejs/io.js/pull/1796 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/dgram.markdown6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown
index 896bf90d30..757230492d 100644
--- a/doc/api/dgram.markdown
+++ b/doc/api/dgram.markdown
@@ -114,9 +114,9 @@ assigned a random port number and is bound to the "all interfaces" address
An optional callback may be specified to detect DNS errors or for determining
when it's safe to reuse the `buf` object. Note that DNS lookups delay the time
to send for at least one tick. The only way to know for sure that the datagram
-has been sent is by using a callback. If an error occurs and a callback is given,
-the error will be the first argument to the callback. If a callback is not given,
-the error is emitted as an `'error'` event on the `socket` object.
+has been sent is by using a callback. If an error occurs and a callback is
+given, the error will be the first argument to the callback. If a callback is
+not given, the error is emitted as an `'error'` event on the `socket` object.
With consideration for multi-byte characters, `offset` and `length` will
be calculated with respect to