Fixed UDP/unix socket conflict and server reference in client
This commit is contained in:
parent
f986c5ec39
commit
711bafb0e0
2 changed files with 6 additions and 4 deletions
|
@ -40,14 +40,14 @@ function connect(){
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!client.port){
|
if(!client.port){
|
||||||
server.log('Connecting client on Unix Socket :'.debug, client.path.variable);
|
client.log('Connecting client on Unix Socket :'.debug, client.path.variable);
|
||||||
client.socket = net.connect(
|
client.socket = net.connect(
|
||||||
{
|
{
|
||||||
path:client.path
|
path:client.path
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
server.log('Connecting client via TCP to'.debug, client.path.variable ,client.port);
|
client.log('Connecting client via TCP to'.debug, client.path.variable ,client.port);
|
||||||
client.socket = net.connect(
|
client.socket = net.connect(
|
||||||
{
|
{
|
||||||
port:client.port,
|
port:client.port,
|
||||||
|
|
|
@ -187,6 +187,8 @@ function init(path,config,log,port){
|
||||||
socket.on(
|
socket.on(
|
||||||
'message',
|
'message',
|
||||||
function(msg,rinfo) {
|
function(msg,rinfo) {
|
||||||
|
if (!rinfo)
|
||||||
|
return;
|
||||||
server.log('Received UDP message from '.debug, rinfo.address.variable, rinfo.port);
|
server.log('Received UDP message from '.debug, rinfo.address.variable, rinfo.port);
|
||||||
socket.emit('data',msg.toString(),rinfo);
|
socket.emit('data',msg.toString(),rinfo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue