diff options
author | OneNail <OneNail@yeah.net> | 2022-05-08 18:54:08 +0300 |
---|---|---|
committer | Bryan English <bryan@bryanenglish.com> | 2022-05-30 19:33:53 +0300 |
commit | 11c783fa63733a8cff9d983b233c04fac88359b3 (patch) | |
tree | ff40f3e42163bf713aa2d179637d2dfafab2e1bd /test | |
parent | 7d8d9d625a513c25641dfff3bc526f261cbb253f (diff) |
net: remoteAddress always undefined called before connected
PR-URL: https://github.com/nodejs/node/pull/43011
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-net-remote-address-port.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-net-remote-address-port.js b/test/parallel/test-net-remote-address-port.js index f7162d0f90f..615f22979c2 100644 --- a/test/parallel/test-net-remote-address-port.js +++ b/test/parallel/test-net-remote-address-port.js @@ -53,6 +53,14 @@ const server = net.createServer(common.mustCall(function(socket) { server.listen(0, function() { const client = net.createConnection(this.address().port, '127.0.0.1'); const client2 = net.createConnection(this.address().port); + + assert.strictEqual(client.remoteAddress, undefined); + assert.strictEqual(client.remoteFamily, undefined); + assert.strictEqual(client.remotePort, undefined); + assert.strictEqual(client2.remoteAddress, undefined); + assert.strictEqual(client2.remoteFamily, undefined); + assert.strictEqual(client2.remotePort, undefined); + client.on('connect', function() { assert.ok(remoteAddrCandidates.includes(client.remoteAddress)); assert.ok(remoteFamilyCandidates.includes(client.remoteFamily)); |