This commit adds a return statement to the dgram.Socket.close()
function that returns itself after it finishes. This follows along
the functionality of the more popular and, dare I say, father-library
`lib/net.js`.
PR-URL: https://github.com/iojs/io.js/pull/214
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
this._handle.close();
this._handle = null;
this.emit('close');
+
+ return this;
};
var socket = dgram.createSocket('udp4');
var handle = socket._handle;
socket.send(buf, 0, buf.length, common.PORT, 'localhost');
-socket.close();
+assert.strictEqual(socket.close(), socket);
socket = null;
// Verify that accessing handle after closure doesn't throw