Changed process.nextTick to setImmediate when socket already closed

This commit is contained in:
Gavin Conway 2017-08-08 15:43:48 +10:00 committed by Mark Vayngrib
parent 69a8e844e3
commit 00f1224167

View File

@ -112,7 +112,7 @@ UdpSocket.prototype.bind = function(port, address, callback) {
UdpSocket.prototype.close = function (callback=noop) {
if (this._destroyed) {
return process.nextTick(callback)
return setImmediate(callback)
}
this.once('close', callback)