File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ var assert = require('assert');
2727var Buffer = require ( 'buffer' ) . Buffer ;
2828var dgram = require ( 'dgram' ) ;
2929
30+ var debug = false ;
3031var tests_run = 0 ;
3132
3233function pingPongTest ( port , host ) {
@@ -36,8 +37,8 @@ function pingPongTest(port, host) {
3637 var sent_final_ping = false ;
3738
3839 var server = dgram . createSocket ( 'udp4' , function ( msg , rinfo ) {
39- console . log ( 'server got: ' + msg +
40- ' from ' + rinfo . address + ':' + rinfo . port ) ;
40+ if ( debug ) console . log ( 'server got: ' + msg +
41+ ' from ' + rinfo . address + ':' + rinfo . port ) ;
4142
4243 if ( / P I N G / . exec ( msg ) ) {
4344 var buf = new Buffer ( 4 ) ;
@@ -61,8 +62,8 @@ function pingPongTest(port, host) {
6162 client = dgram . createSocket ( 'udp4' ) ;
6263
6364 client . on ( 'message' , function ( msg , rinfo ) {
64- console . log ( 'client got: ' + msg +
65- ' from ' + rinfo . address + ':' + rinfo . port ) ;
65+ if ( debug ) console . log ( 'client got: ' + msg +
66+ ' from ' + rinfo . address + ':' + rinfo . port ) ;
6667 assert . equal ( 'PONG' , msg . toString ( 'ascii' ) ) ;
6768
6869 count += 1 ;
You can’t perform that action at this time.
0 commit comments