Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-01-24 00:36:48 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2012-01-24 03:05:34 +0400
commit6999fb3d1e342cc5bcd41c5ff41ff0c88ddfb250 (patch)
tree7c4e94a842258b54f7bc2a9056322da00e730544 /lib
parentfc6a9673c8ec6e22565bb5a837f33b845e5127ce (diff)
dgram: make addMembership() and dropMembership() conform to v0.4 API
- throw on error, don't return an error code
Diffstat (limited to 'lib')
-rw-r--r--lib/dgram.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/dgram.js b/lib/dgram.js
index 2e8071ca121..ee239558199 100644
--- a/lib/dgram.js
+++ b/lib/dgram.js
@@ -260,7 +260,9 @@ Socket.prototype.addMembership = function(multicastAddress,
throw new Error('multicast address must be specified');
}
- return this._handle.addMembership(multicastAddress, interfaceAddress);
+ if (this._handle.addMembership(multicastAddress, interfaceAddress)) {
+ throw new errnoException(errno, 'addMembership');
+ }
};
@@ -272,7 +274,9 @@ Socket.prototype.dropMembership = function(multicastAddress,
throw new Error('multicast address must be specified');
}
- return this._handle.dropMembership(multicastAddress, interfaceAddress);
+ if (this._handle.dropMembership(multicastAddress, interfaceAddress)) {
+ throw new errnoException(errno, 'dropMembership');
+ }
};