diff --git a/lib/dgram.js b/lib/dgram.js index 743dc9abcd0..7abd0c32ccd 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -91,7 +91,7 @@ function Socket(type, listener) { events.EventEmitter.call(this); var handle = newHandle(type); - handle.socket = this; + handle.owner = this; this._handle = handle; this._receiving = false; @@ -200,7 +200,7 @@ Socket.prototype.send = function(buffer, function afterSend(status, handle, req, buffer) { - var self = handle.socket; + var self = handle.owner; // CHECKME socket's been closed by user, don't call callback? if (handle !== self._handle) @@ -344,7 +344,7 @@ Socket.prototype._stopReceiving = function() { function onMessage(handle, slab, start, len, rinfo) { - var self = handle.socket; + var self = handle.owner; if (!slab) return self.emit('error', errnoException(errno, 'recvmsg')); rinfo.size = len; // compatibility self.emit('message', slab.slice(start, start + len), rinfo);