aboutsummaryrefslogtreecommitdiff
path: root/lib/dgram.js
diff options
context:
space:
mode:
authorRoman Shtylman <shtylman@gmail.com>2011-10-12 13:55:15 -0400
committerBen Noordhuis <info@bnoordhuis.nl>2012-01-21 03:21:51 +0100
commita38fd6056c2c6d4e2266a65fdefdbdc8dcbe4dee (patch)
tree25fd596fb5e3c51501038a8bca0e9a5cd24bbf10 /lib/dgram.js
parent08ab306afd0161aebde527a145c49cb848718df2 (diff)
downloadandroid-node-v8-a38fd6056c2c6d4e2266a65fdefdbdc8dcbe4dee.tar.gz
android-node-v8-a38fd6056c2c6d4e2266a65fdefdbdc8dcbe4dee.tar.bz2
android-node-v8-a38fd6056c2c6d4e2266a65fdefdbdc8dcbe4dee.zip
dgram: reintroduce addMembership() and dropMembership()
Removed during the early stages of node 0.5 refactoring to libuv.
Diffstat (limited to 'lib/dgram.js')
-rw-r--r--lib/dgram.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/dgram.js b/lib/dgram.js
index 26e0a2a3e8..42473b40e7 100644
--- a/lib/dgram.js
+++ b/lib/dgram.js
@@ -243,16 +243,26 @@ Socket.prototype.setMulticastLoopback = function(arg) {
Socket.prototype.addMembership = function(multicastAddress,
- multicastInterface) {
- // are we ever going to support this in libuv?
- throw new Error('not yet implemented');
+ interfaceAddress) {
+ this._healthCheck();
+
+ if (!multicastAddress) {
+ throw new Error('multicast address must be specified');
+ }
+
+ return this._handle.addMembership(multicastAddress, interfaceAddress);
};
Socket.prototype.dropMembership = function(multicastAddress,
- multicastInterface) {
- // are we ever going to support this in libuv?
- throw new Error('not yet implemented');
+ interfaceAddress) {
+ this._healthCheck();
+
+ if (!multicastAddress) {
+ throw new Error('multicast address must be specified');
+ }
+
+ return this._handle.dropMembership(multicastAddress, interfaceAddress);
};