@@ -12,19 +12,19 @@ if (process.argv[2] === 'child') {
12
12
process . on ( 'message' , function ( m , socket ) {
13
13
if ( ! socket ) return ;
14
14
15
- console . error ( '[%d ] got socket' , id , m ) ;
15
+ console . error ( `[ ${ id } ] got socket ${ m } ` ) ;
16
16
17
17
// will call .end('end') or .write('write');
18
18
socket [ m ] ( m ) ;
19
19
20
20
socket . resume ( ) ;
21
21
22
22
socket . on ( 'data' , function ( ) {
23
- console . error ( '[%d ] socket.data' , id , m ) ;
23
+ console . error ( `[ ${ id } ] socket.data ${ m } ` ) ;
24
24
} ) ;
25
25
26
26
socket . on ( 'end' , function ( ) {
27
- console . error ( '[%d ] socket.end' , id , m ) ;
27
+ console . error ( `[ ${ id } ] socket.end ${ m } ` ) ;
28
28
} ) ;
29
29
30
30
// store the unfinished socket
@@ -33,27 +33,27 @@ if (process.argv[2] === 'child') {
33
33
}
34
34
35
35
socket . on ( 'close' , function ( had_error ) {
36
- console . error ( '[%d ] socket.close' , id , had_error , m ) ;
36
+ console . error ( `[ ${ id } ] socket.close ${ had_error } ${ m } ` ) ;
37
37
} ) ;
38
38
39
39
socket . on ( 'finish' , function ( ) {
40
- console . error ( '[%d ] socket finished' , id , m ) ;
40
+ console . error ( `[ ${ id } ] socket finished ${ m } ` ) ;
41
41
} ) ;
42
42
} ) ;
43
43
44
44
process . on ( 'message' , function ( m ) {
45
45
if ( m !== 'close' ) return ;
46
- console . error ( '[%d ] got close message' , id ) ;
46
+ console . error ( `[ ${ id } ] got close message` ) ;
47
47
needEnd . forEach ( function ( endMe , i ) {
48
- console . error ( '[%d ] ending %d/%d' , id , i , needEnd . length ) ;
48
+ console . error ( `[ ${ id } ] ending ${ i } / ${ needEnd . length } ` ) ;
49
49
endMe . end ( 'end' ) ;
50
50
} ) ;
51
51
} ) ;
52
52
53
53
process . on ( 'disconnect' , function ( ) {
54
- console . error ( '[%d ] process disconnect, ending' , id ) ;
54
+ console . error ( `[ ${ id } ] process disconnect, ending` ) ;
55
55
needEnd . forEach ( function ( endMe , i ) {
56
- console . error ( '[%d ] ending %d/%d' , id , i , needEnd . length ) ;
56
+ console . error ( `[ ${ id } ] ending ${ i } / ${ needEnd . length } ` ) ;
57
57
endMe . end ( 'end' ) ;
58
58
} ) ;
59
59
} ) ;
@@ -86,7 +86,7 @@ if (process.argv[2] === 'child') {
86
86
connected += 1 ;
87
87
88
88
socket . once ( 'close' , function ( ) {
89
- console . log ( ' [m] socket closed, total %d' , ++ closed ) ;
89
+ console . log ( ` [m] socket closed, total ${ ++ closed } ` ) ;
90
90
} ) ;
91
91
92
92
if ( connected === count ) {
0 commit comments