@@ -38,10 +38,10 @@ const assert = require('assert');
38
38
if ( process . argv [ 2 ] === 'child' ) {
39
39
let childServer ;
40
40
41
- process . once ( 'message' , function ( msg , clusterServer ) {
41
+ process . once ( 'message' , ( msg , clusterServer ) => {
42
42
childServer = clusterServer ;
43
43
44
- childServer . once ( 'message' , function ( ) {
44
+ childServer . once ( 'message' , ( ) => {
45
45
process . send ( 'gotMessage' ) ;
46
46
childServer . close ( ) ;
47
47
} ) ;
@@ -59,15 +59,15 @@ if (process.argv[2] === 'child') {
59
59
let childGotMessage = false ;
60
60
let parentGotMessage = false ;
61
61
62
- parentServer . once ( 'message' , function ( msg , rinfo ) {
62
+ parentServer . once ( 'message' , ( msg , rinfo ) => {
63
63
parentGotMessage = true ;
64
64
parentServer . close ( ) ;
65
65
} ) ;
66
66
67
- parentServer . on ( 'listening' , function ( ) {
67
+ parentServer . on ( 'listening' , ( ) => {
68
68
child . send ( 'server' , parentServer ) ;
69
69
70
- child . on ( 'message' , function ( msg ) {
70
+ child . on ( 'message' , ( msg ) => {
71
71
if ( msg === 'gotMessage' ) {
72
72
childGotMessage = true ;
73
73
} else if ( msg = 'handlReceived' ) {
@@ -79,7 +79,7 @@ if (process.argv[2] === 'child') {
79
79
function sendMessages ( ) {
80
80
const serverPort = parentServer . address ( ) . port ;
81
81
82
- const timer = setInterval ( function ( ) {
82
+ const timer = setInterval ( ( ) => {
83
83
/*
84
84
* Both the parent and the child got at least one message,
85
85
* test passed, clean up everything.
@@ -94,7 +94,7 @@ if (process.argv[2] === 'child') {
94
94
msg . length ,
95
95
serverPort ,
96
96
'127.0.0.1' ,
97
- function ( err ) {
97
+ ( err ) => {
98
98
assert . ifError ( err ) ;
99
99
}
100
100
) ;
@@ -104,7 +104,7 @@ if (process.argv[2] === 'child') {
104
104
105
105
parentServer . bind ( 0 , '127.0.0.1' ) ;
106
106
107
- process . once ( 'exit' , function ( ) {
107
+ process . once ( 'exit' , ( ) => {
108
108
assert ( parentGotMessage ) ;
109
109
assert ( childGotMessage ) ;
110
110
} ) ;
0 commit comments