mirror of https://github.com/nodejs/node.git
dgram: make addMembership() and dropMembership() conform to v0.4 API
- throw on error, don't return an error codev0.7.4-release
parent
fc6a9673c8
commit
6999fb3d1e
|
@ -260,7 +260,9 @@ Socket.prototype.addMembership = function(multicastAddress,
|
||||||
throw new Error('multicast address must be specified');
|
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');
|
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');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue