net: deduplicate Socket.prototype.address
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
2272052461
commit
940974ed03
@ -340,13 +340,7 @@ Socket.prototype.setKeepAlive = function(setting, msecs) {
|
||||
|
||||
|
||||
Socket.prototype.address = function() {
|
||||
if (this._handle && this._handle.getsockname) {
|
||||
var out = {};
|
||||
var err = this._handle.getsockname(out);
|
||||
// TODO(bnoordhuis) Check err and throw?
|
||||
return out;
|
||||
}
|
||||
return null;
|
||||
return this._getsockname();
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user