dgram: defer send error to next tick

This commit is contained in:
Ben Noordhuis 2012-02-23 01:52:45 +01:00
parent defa637378
commit 3502e45b6c

View File

@ -189,7 +189,10 @@ Socket.prototype.send = function(buffer,
} }
else { else {
// don't emit as error, dgram_legacy.js compatibility // don't emit as error, dgram_legacy.js compatibility
callback(errnoException(errno, 'send')); var err = errnoException(errno, 'send');
process.nextTick(function() {
callback(err);
});
} }
} }
}); });