diff options
author | Roman Shtylman <shtylman@gmail.com> | 2011-10-12 13:55:15 -0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-01-21 03:21:51 +0100 |
commit | a38fd6056c2c6d4e2266a65fdefdbdc8dcbe4dee (patch) | |
tree | 25fd596fb5e3c51501038a8bca0e9a5cd24bbf10 /lib/dgram.js | |
parent | 08ab306afd0161aebde527a145c49cb848718df2 (diff) | |
download | android-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.js | 22 |
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); }; |