dgram: partially revert 18d457b
authorSaúl Ibarra Corretgé <saghul@gmail.com>
Wed, 27 May 2015 07:43:02 +0000 (09:43 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Wed, 3 Jun 2015 22:09:39 +0000 (00:09 +0200)
Revert "dgram: call send callback asynchronously" partially, since the
fix is now done in libuv.

Refs: https://github.com/nodejs/io.js/pull/1313
Refs: https://github.com/libuv/libuv/pull/371
PR-URL: https://github.com/nodejs/io.js/pull/1889
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
lib/dgram.js

index f30e562..2b65b94 100644 (file)
@@ -332,10 +332,7 @@ function afterSend(err) {
   if (err) {
     err = exceptionWithHostPort(err, 'send', this.address, this.port);
   }
-  var self = this;
-  setImmediate(function() {
-    self.callback(err, self.length);
-  });
+  this.callback(err, this.length);
 }