From 3502e45b6c05eeabf9eae1ec8c455eedcdac79f8 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 23 Feb 2012 01:52:45 +0100 Subject: [PATCH] dgram: defer send error to next tick --- lib/dgram.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/dgram.js b/lib/dgram.js index ae280c737d9..2c2cbe13132 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -189,7 +189,10 @@ Socket.prototype.send = function(buffer, } else { // don't emit as error, dgram_legacy.js compatibility - callback(errnoException(errno, 'send')); + var err = errnoException(errno, 'send'); + process.nextTick(function() { + callback(err); + }); } } });