11'use strict' ;
2- var common = require ( '../common' ) ,
3- assert = require ( 'assert' ) ,
4- dgram = require ( 'dgram' ) ,
5- util = require ( 'util' ) ,
6- networkInterfaces = require ( 'os' ) . networkInterfaces ( ) ,
7- Buffer = require ( 'buffer' ) . Buffer ,
8- fork = require ( 'child_process' ) . fork ,
9- LOCAL_BROADCAST_HOST = '255.255.255.255' ,
10- TIMEOUT = common . platformTimeout ( 5000 ) ,
11- messages = [
12- new Buffer ( 'First message to send' ) ,
13- new Buffer ( 'Second message to send' ) ,
14- new Buffer ( 'Third message to send' ) ,
15- new Buffer ( 'Fourth message to send' )
16- ] ;
2+ const common = require ( '../common' ) ;
3+ const assert = require ( 'assert' ) ;
4+ const dgram = require ( 'dgram' ) ;
5+ const util = require ( 'util' ) ;
6+ const networkInterfaces = require ( 'os' ) . networkInterfaces ( ) ;
7+ const Buffer = require ( 'buffer' ) . Buffer ;
8+ const fork = require ( 'child_process' ) . fork ;
9+ const LOCAL_BROADCAST_HOST = '255.255.255.255' ;
10+ const TIMEOUT = common . platformTimeout ( 5000 ) ;
11+ const messages = [
12+ new Buffer ( 'First message to send' ) ,
13+ new Buffer ( 'Second message to send' ) ,
14+ new Buffer ( 'Third message to send' ) ,
15+ new Buffer ( 'Fourth message to send' )
16+ ] ;
1717
1818if ( common . inFreeBSDJail ) {
1919 console . log ( '1..0 # Skipped: in a FreeBSD jail' ) ;
@@ -34,13 +34,13 @@ get_bindAddress: for (var name in networkInterfaces) {
3434assert . ok ( bindAddress ) ;
3535
3636if ( process . argv [ 2 ] !== 'child' ) {
37- var workers = { } ,
38- listeners = 3 ,
39- listening = 0 ,
40- dead = 0 ,
41- i = 0 ,
42- done = 0 ,
43- timer = null ;
37+ const workers = { } ;
38+ const listeners = 3 ;
39+ let listening = 0 ;
40+ let dead = 0 ;
41+ let i = 0 ;
42+ let done = 0 ;
43+ let timer = null ;
4444
4545 //exit the test if it doesn't succeed within TIMEOUT
4646 timer = setTimeout ( function ( ) {
@@ -166,15 +166,21 @@ if (process.argv[2] !== 'child') {
166166 return ;
167167 }
168168
169- sendSocket . send ( buf , 0 , buf . length ,
170- common . PORT , LOCAL_BROADCAST_HOST , function ( err ) {
171- if ( err ) throw err ;
172- console . error ( '[PARENT] sent %s to %s:%s' ,
173- util . inspect ( buf . toString ( ) ) ,
174- LOCAL_BROADCAST_HOST , common . PORT ) ;
175-
176- process . nextTick ( sendSocket . sendNext ) ;
177- } ) ;
169+ sendSocket . send (
170+ buf ,
171+ 0 ,
172+ buf . length ,
173+ common . PORT ,
174+ LOCAL_BROADCAST_HOST ,
175+ function ( err ) {
176+ if ( err ) throw err ;
177+ console . error ( '[PARENT] sent %s to %s:%s' ,
178+ util . inspect ( buf . toString ( ) ) ,
179+ LOCAL_BROADCAST_HOST , common . PORT ) ;
180+
181+ process . nextTick ( sendSocket . sendNext ) ;
182+ }
183+ ) ;
178184 } ;
179185
180186 function killChildren ( children ) {
0 commit comments