| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 98d262e commit 724bf31
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ | |||
| 20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | - const common = require('../common'); | ||
| 23 | + require('../common'); | ||
| 24 | 24 | const assert = require('assert'); | |
| 25 | 25 | const net = require('net'); | |
| 26 | 26 | ||
@@ -54,10 +54,11 @@ const echo_server = net.createServer((socket) => { | |||
| 54 | 54 | }); | |
| 55 | 55 | }); | |
| 56 | 56 | ||
| 57 | - echo_server.listen(common.PORT, () => { | ||
| 58 | - console.log(`server listening at ${common.PORT}`); | ||
| 57 | + echo_server.listen(0, () => { | ||
| 58 | + const port = echo_server.address().port; | ||
| 59 | + console.log(`server listening at ${port}`); | ||
| 59 | 60 | ||
| 60 | - const client = net.createConnection(common.PORT); | ||
| 61 | + const client = net.createConnection(port); | ||
| 61 | 62 | client.setEncoding('UTF8'); | |
| 62 | 63 | client.setTimeout(0); // Disable the timeout for client | |
| 63 | 64 | client.on('connect', () => { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments