@@ -37,12 +37,12 @@ const server = net.createServer(function(socket) {
3737 console.error('SERVER connect, writing');
3838 socket.write('hello\r\n');
3939
40- socket.on('end', function() {
40+ socket.on('end', () => {
4141 console.error('SERVER socket end, calling end()');
4242 socket.end();
4343 });
4444
45- socket.on('close', function (had_error) {
45+ socket.on('close', (had_error) => {
4646 console.log(`SERVER had_error: ${JSON.stringify(had_error)}`);
4747 assert.strictEqual(had_error, false);
4848 });
@@ -54,7 +54,7 @@ server.listen(0, function() {
5454
5555 client.setEncoding('UTF8');
5656
57- client.on('connect', function() {
57+ client.on('connect', () => {
5858 console.error('CLIENT connected', client._writableState);
5959 });
6060
@@ -66,12 +66,12 @@ server.listen(0, function() {
6666 client.end();
6767 });
6868
69- client.on('end', function() {
69+ client.on('end', () => {
7070 console.error('CLIENT end');
7171 client_end_count++;
7272 });
7373
74- client.on('close', function (had_error) {
74+ client.on('close', (had_error) => {
7575 console.log('CLIENT disconnect');
7676 assert.strictEqual(had_error, false);
7777 if (disconnect_count++ < N)
@@ -81,7 +81,7 @@ server.listen(0, function() {
8181 });
8282});
8383
84- process.on('exit', function() {
84+ process.on('exit', () => {
8585 assert.strictEqual(disconnect_count, N + 1);
8686 assert.strictEqual(client_recv_count, N + 1);
8787 assert.strictEqual(client_end_count, N + 1);
0 commit comments