@@ -33,19 +33,19 @@ if (process.argv[2] === 'child') {
33
33
process . on ( 'message' , function ( m , socket ) {
34
34
if ( ! socket ) return ;
35
35
36
- console . error ( '[%d ] got socket' , id , m ) ;
36
+ console . error ( `[ ${ id } ] got socket ${ m } ` ) ;
37
37
38
38
// will call .end('end') or .write('write');
39
39
socket [ m ] ( m ) ;
40
40
41
41
socket . resume ( ) ;
42
42
43
43
socket . on ( 'data' , function ( ) {
44
- console . error ( '[%d ] socket.data' , id , m ) ;
44
+ console . error ( `[ ${ id } ] socket.data ${ m } ` ) ;
45
45
} ) ;
46
46
47
47
socket . on ( 'end' , function ( ) {
48
- console . error ( '[%d ] socket.end' , id , m ) ;
48
+ console . error ( `[ ${ id } ] socket.end ${ m } ` ) ;
49
49
} ) ;
50
50
51
51
// store the unfinished socket
@@ -54,27 +54,27 @@ if (process.argv[2] === 'child') {
54
54
}
55
55
56
56
socket . on ( 'close' , function ( had_error ) {
57
- console . error ( '[%d ] socket.close' , id , had_error , m ) ;
57
+ console . error ( `[ ${ id } ] socket.close ${ had_error } ${ m } ` ) ;
58
58
} ) ;
59
59
60
60
socket . on ( 'finish' , function ( ) {
61
- console . error ( '[%d ] socket finished' , id , m ) ;
61
+ console . error ( `[ ${ id } ] socket finished ${ m } ` ) ;
62
62
} ) ;
63
63
} ) ;
64
64
65
65
process . on ( 'message' , function ( m ) {
66
66
if ( m !== 'close' ) return ;
67
- console . error ( '[%d ] got close message' , id ) ;
67
+ console . error ( `[ ${ id } ] got close message` ) ;
68
68
needEnd . forEach ( function ( endMe , i ) {
69
- console . error ( '[%d ] ending %d/%d' , id , i , needEnd . length ) ;
69
+ console . error ( `[ ${ id } ] ending ${ i } / ${ needEnd . length } ` ) ;
70
70
endMe . end ( 'end' ) ;
71
71
} ) ;
72
72
} ) ;
73
73
74
74
process . on ( 'disconnect' , function ( ) {
75
- console . error ( '[%d ] process disconnect, ending' , id ) ;
75
+ console . error ( `[ ${ id } ] process disconnect, ending` ) ;
76
76
needEnd . forEach ( function ( endMe , i ) {
77
- console . error ( '[%d ] ending %d/%d' , id , i , needEnd . length ) ;
77
+ console . error ( `[ ${ id } ] ending ${ i } / ${ needEnd . length } ` ) ;
78
78
endMe . end ( 'end' ) ;
79
79
} ) ;
80
80
} ) ;
@@ -107,7 +107,7 @@ if (process.argv[2] === 'child') {
107
107
connected += 1 ;
108
108
109
109
socket . once ( 'close' , function ( ) {
110
- console . log ( ' [m] socket closed, total %d' , ++ closed ) ;
110
+ console . log ( ` [m] socket closed, total ${ ++ closed } ` ) ;
111
111
} ) ;
112
112
113
113
if ( connected === count ) {
0 commit comments