diff --git a/lib/socketServer.js b/lib/socketServer.js index a493e8c..92ea617 100644 --- a/lib/socketServer.js +++ b/lib/socketServer.js @@ -182,8 +182,9 @@ function init(path,config,log,port){ function serverCreated(socket) { server.sockets.push(socket); - if(socket.setEncoding) + if(socket.setEncoding){ socket.setEncoding(server.config.encoding); + } server.log('## socket connection to server detected ##'.rainbow); socket.on( @@ -219,8 +220,9 @@ function init(path,config,log,port){ return; } - if(!this.ipcBuffer) + if(!this.ipcBuffer){ this.ipcBuffer=''; + } data=(this.ipcBuffer+=data); @@ -254,8 +256,10 @@ function init(path,config,log,port){ socket.on( 'message', function(msg,rinfo) { - if (!rinfo) + if (!rinfo){ return; + } + server.log('Received UDP message from '.debug, rinfo.address.variable, rinfo.port); let data; diff --git a/spec/support/jasmineTest/TCP/tcpSocketClient.spec.js b/spec/support/jasmineTest/TCP/tcpSocketClient.spec.js index 3c76f9d..1094ff1 100644 --- a/spec/support/jasmineTest/TCP/tcpSocketClient.spec.js +++ b/spec/support/jasmineTest/TCP/tcpSocketClient.spec.js @@ -1,3 +1,4 @@ +/*global describe, expect, it*/ 'use strict'; const ipc = require('../../../../node-ipc'); diff --git a/spec/support/jasmineTest/TCP/tcpSocketServer.spec.js b/spec/support/jasmineTest/TCP/tcpSocketServer.spec.js index 88e6ac6..c691d7a 100644 --- a/spec/support/jasmineTest/TCP/tcpSocketServer.spec.js +++ b/spec/support/jasmineTest/TCP/tcpSocketServer.spec.js @@ -1,3 +1,4 @@ +/*global describe, expect, it*/ 'use strict'; const ipc = require('../../../../node-ipc'); diff --git a/spec/support/jasmineTest/UDP/udpSocketClient.spec.js b/spec/support/jasmineTest/UDP/udpSocketClient.spec.js index de88624..640fb4f 100644 --- a/spec/support/jasmineTest/UDP/udpSocketClient.spec.js +++ b/spec/support/jasmineTest/UDP/udpSocketClient.spec.js @@ -1,3 +1,4 @@ +/*global describe, expect, it*/ 'use strict'; const ipc = require('../../../../node-ipc'); diff --git a/spec/support/jasmineTest/Unix/unixSocketClient.spec.js b/spec/support/jasmineTest/Unix/unixSocketClient.spec.js index bc028b1..d52ea6d 100644 --- a/spec/support/jasmineTest/Unix/unixSocketClient.spec.js +++ b/spec/support/jasmineTest/Unix/unixSocketClient.spec.js @@ -1,3 +1,4 @@ +/*global describe, expect, it*/ 'use strict'; const ipc = require('../../../../node-ipc'); diff --git a/spec/support/jasmineTest/Unix/unixSocketServer.spec.js b/spec/support/jasmineTest/Unix/unixSocketServer.spec.js index fb35092..17cb555 100644 --- a/spec/support/jasmineTest/Unix/unixSocketServer.spec.js +++ b/spec/support/jasmineTest/Unix/unixSocketServer.spec.js @@ -1,3 +1,4 @@ +/*global describe, expect, it*/ 'use strict'; const ipc = require('../../../../node-ipc'); diff --git a/spec/support/jasmineTest/unixServerSync.js b/spec/support/jasmineTest/unixServerSync.js index f937828..b193340 100644 --- a/spec/support/jasmineTest/unixServerSync.js +++ b/spec/support/jasmineTest/unixServerSync.js @@ -20,7 +20,6 @@ ipc.config.silent=true; ipc.serve( function serverStarted(){ let ready=false; - let messageDelay=500; ipc.server.on( 'message',