summaryrefslogtreecommitdiff
path: root/lib/dgram.js
diff options
context:
space:
mode:
authorYosuke Furukawa <yosuke.furukawa@gmail.com>2015-04-01 23:32:48 +0900
committerYosuke Furukawa <yosuke.furukawa@gmail.com>2015-05-10 12:03:21 +0900
commit18d457bd3408557a48b453f13b2b99e1ab5e7159 (patch)
treebc0bece749bfac62be77dbd9f4ed2e86b7c5888b /lib/dgram.js
parentaed6bce9064915bda28237b1a5fbf7fcdbf439ef (diff)
downloadandroid-node-v8-18d457bd3408557a48b453f13b2b99e1ab5e7159.tar.gz
android-node-v8-18d457bd3408557a48b453f13b2b99e1ab5e7159.tar.bz2
android-node-v8-18d457bd3408557a48b453f13b2b99e1ab5e7159.zip
dgram: call send callback asynchronously
dgram#send callback was changed synchronously. The PR-URL is here https://github.com/joyent/libuv/pull/1358 This commit is temporary fix until libuv issue is resolved. https://github.com/libuv/libuv/issues/301 PR-URL: https://github.com/iojs/io.js/pull/1313 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'lib/dgram.js')
-rw-r--r--lib/dgram.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/dgram.js b/lib/dgram.js
index e80f78da07..1cce233eab 100644
--- a/lib/dgram.js
+++ b/lib/dgram.js
@@ -337,7 +337,10 @@ function afterSend(err) {
if (err) {
err = exceptionWithHostPort(err, 'send', this.address, this.port);
}
- this.callback(err, this.length);
+ var self = this;
+ setImmediate(function() {
+ self.callback(err, self.length);
+ });
}