Fixed UDP/unix socket conflict and server reference in client

This commit is contained in:
Walter P. Little 2014-02-27 12:31:40 -08:00
parent f986c5ec39
commit 711bafb0e0
2 changed files with 6 additions and 4 deletions

View file

@ -40,14 +40,14 @@ function connect(){
}
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(
{
path:client.path
}
);
}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(
{
port:client.port,
@ -111,4 +111,4 @@ function connect(){
);
}
module.exports=init;
module.exports=init;

View file

@ -187,6 +187,8 @@ function init(path,config,log,port){
socket.on(
'message',
function(msg,rinfo) {
if (!rinfo)
return;
server.log('Received UDP message from '.debug, rinfo.address.variable, rinfo.port);
socket.emit('data',msg.toString(),rinfo);
}
@ -309,4 +311,4 @@ function init(path,config,log,port){
return server;
}
module.exports=init;
module.exports=init;