File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 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
@@ -43,7 +43,7 @@ const server = net.createServer((connection) => {
43
43
} ) ;
44
44
45
45
server . on ( 'listening' , ( ) => {
46
- const client = net . createConnection ( common . PORT ) ;
46
+ const client = net . createConnection ( server . address ( ) . port ) ;
47
47
client . setEncoding ( 'ascii' ) ;
48
48
client . on ( 'data' , ( d ) => {
49
49
console . log ( d ) ;
@@ -83,7 +83,7 @@ server.on('listening', () => {
83
83
client . end ( ) ;
84
84
} ) ;
85
85
} ) ;
86
- server . listen ( common . PORT ) ;
86
+ server . listen ( 0 ) ;
87
87
88
88
process . on ( 'exit' , ( ) => {
89
89
assert . strictEqual ( recv . length , N ) ;
You can’t perform that action at this time.
0 commit comments