summaryrefslogtreecommitdiff
path: root/lib/dgram.js
diff options
context:
space:
mode:
authorRoman Reiss <me@silverwind.io>2015-05-22 18:35:57 +0200
committerRoman Reiss <me@silverwind.io>2015-05-23 06:57:00 +0200
commit39dde3222e4733fc1b59c45e392d9ff1a88ae4cc (patch)
tree58561a0bbbbf02422b8b34d1b41e58fcb3b388b9 /lib/dgram.js
parent9da168b71fb729635ad71e839630480e815623d0 (diff)
downloadandroid-node-v8-39dde3222e4733fc1b59c45e392d9ff1a88ae4cc.tar.gz
android-node-v8-39dde3222e4733fc1b59c45e392d9ff1a88ae4cc.tar.bz2
android-node-v8-39dde3222e4733fc1b59c45e392d9ff1a88ae4cc.zip
net,dgram: return this from ref and unref methods
Modifies the following methods to return the instance instead of undefined, to allow for chaining these methods: - net.Server.ref - net.Server.unref - net.Socket.ref - net.Socket.unref - dgram.Socket.ref - dgram.Socket.unref PR-URL: https://github.com/nodejs/io.js/pull/1768 Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'lib/dgram.js')
-rw-r--r--lib/dgram.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dgram.js b/lib/dgram.js
index 1cce233eab..f95b449269 100644
--- a/lib/dgram.js
+++ b/lib/dgram.js
@@ -481,10 +481,14 @@ function onMessage(nread, handle, buf, rinfo) {
Socket.prototype.ref = function() {
if (this._handle)
this._handle.ref();
+
+ return this;
};
Socket.prototype.unref = function() {
if (this._handle)
this._handle.unref();
+
+ return this;
};