| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f3417e2 commit 4b43bf0
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,4 +21,3 @@ test-child-process-exit-code : PASS,FLAKY | |||
| 21 | 21 | [$system==solaris] # Also applies to SmartOS | |
| 22 | 22 | ||
| 23 | 23 | [$system==freebsd] | |
| 24 | - test-net-socket-local-address : PASS,FLAKY | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,7 +15,7 @@ var serverRemotePorts = []; | |||
| 15 | 15 | ||
| 16 | 16 | const server = net.createServer(function(socket) { | |
| 17 | 17 | serverRemotePorts.push(socket.remotePort); | |
| 18 | - conns++; | ||
| 18 | + testConnect(); | ||
| 19 | 19 | }); | |
| 20 | 20 | ||
| 21 | 21 | const client = new net.Socket(); | |
@@ -29,12 +29,18 @@ server.on('close', common.mustCall(function() { | |||
| 29 | 29 | server.listen(common.PORT, common.localhostIPv4, testConnect); | |
| 30 | 30 | ||
| 31 | 31 | function testConnect() { | |
| 32 | - if (conns == 2) { | ||
| 32 | + if (conns > serverRemotePorts.length || conns > clientLocalPorts.length) { | ||
| 33 | + // We're waiting for a callback to fire. | ||
| 34 | + return; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + if (conns === 2) { | ||
| 33 | 38 | return server.close(); | |
| 34 | 39 | } | |
| 35 | 40 | client.connect(common.PORT, common.localhostIPv4, function() { | |
| 36 | 41 | clientLocalPorts.push(this.localPort); | |
| 37 | 42 | this.once('close', testConnect); | |
| 38 | 43 | this.destroy(); | |
| 39 | 44 | }); | |
| 45 | + conns++; | ||
| 40 | 46 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments