@@ -37,12 +37,12 @@ const server = net.createServer(function(socket) {
37
37
console . error ( 'SERVER connect, writing' ) ;
38
38
socket . write ( 'hello\r\n' ) ;
39
39
40
- socket . on ( 'end' , function ( ) {
40
+ socket . on ( 'end' , ( ) => {
41
41
console . error ( 'SERVER socket end, calling end()' ) ;
42
42
socket . end ( ) ;
43
43
} ) ;
44
44
45
- socket . on ( 'close' , function ( had_error ) {
45
+ socket . on ( 'close' , ( had_error ) => {
46
46
console . log ( `SERVER had_error: ${ JSON . stringify ( had_error ) } ` ) ;
47
47
assert . strictEqual ( had_error , false ) ;
48
48
} ) ;
@@ -54,7 +54,7 @@ server.listen(0, function() {
54
54
55
55
client . setEncoding ( 'UTF8' ) ;
56
56
57
- client . on ( 'connect' , function ( ) {
57
+ client . on ( 'connect' , ( ) => {
58
58
console . error ( 'CLIENT connected' , client . _writableState ) ;
59
59
} ) ;
60
60
@@ -66,12 +66,12 @@ server.listen(0, function() {
66
66
client . end ( ) ;
67
67
} ) ;
68
68
69
- client . on ( 'end' , function ( ) {
69
+ client . on ( 'end' , ( ) => {
70
70
console . error ( 'CLIENT end' ) ;
71
71
client_end_count ++ ;
72
72
} ) ;
73
73
74
- client . on ( 'close' , function ( had_error ) {
74
+ client . on ( 'close' , ( had_error ) => {
75
75
console . log ( 'CLIENT disconnect' ) ;
76
76
assert . strictEqual ( had_error , false ) ;
77
77
if ( disconnect_count ++ < N )
@@ -81,7 +81,7 @@ server.listen(0, function() {
81
81
} ) ;
82
82
} ) ;
83
83
84
- process . on ( 'exit' , function ( ) {
84
+ process . on ( 'exit' , ( ) => {
85
85
assert . strictEqual ( disconnect_count , N + 1 ) ;
86
86
assert . strictEqual ( client_recv_count , N + 1 ) ;
87
87
assert . strictEqual ( client_end_count , N + 1 ) ;
0 commit comments