diff options
author | theanarkh <theratliter@gmail.com> | 2022-07-27 01:37:49 +0300 |
---|---|---|
committer | Juan José Arboleda <soyjuanarbol@gmail.com> | 2022-10-11 22:45:20 +0300 |
commit | 092239a7f1169719fbf39b6802beb4b1a1d3f2ce (patch) | |
tree | 0deac4f0eb78c8ac29ec518fc6de9c2aec9e4117 /lib | |
parent | 579e066c3a1c2f4b0aaf81b51d60cdc7107e7e0b (diff) |
net: add local family
PR-URL: https://github.com/nodejs/node/pull/43975
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/net.js b/lib/net.js index 5f2aa9c5de1..6b5ce6f91eb 100644 --- a/lib/net.js +++ b/lib/net.js @@ -849,6 +849,9 @@ protoGetter('localPort', function localPort() { return this._getsockname().port; }); +protoGetter('localFamily', function localFamily() { + return this._getsockname().family; +}); Socket.prototype[kAfterAsyncWrite] = function() { this[kLastWriteQueueSize] = 0; @@ -1683,6 +1686,7 @@ function onconnection(err, clientHandle) { clientHandle.getsockname(localInfo); data.localAddress = localInfo.address; data.localPort = localInfo.port; + data.localFamily = localInfo.family; } if (clientHandle.getpeername) { const remoteInfo = ObjectCreate(null); |