Comparing version 8.9.3 to 8.10.0
@@ -73,26 +73,43 @@ 'use strict'; | ||
const options={}; | ||
if(!client.port){ | ||
client.log('Connecting client on Unix Socket :', client.path); | ||
let path = client.path; | ||
options.path=client.path; | ||
if (process.platform ==='win32' && !client.path.startsWith('\\\\.\\pipe\\')){ | ||
path = path.replace(/^\//, ''); | ||
path = path.replace(/\//g, '-'); | ||
path= `\\\\.\\pipe\\${path}`; | ||
options.path = options.path.replace(/^\//, ''); | ||
options.path = options.path.replace(/\//g, '-'); | ||
options.path= `\\\\.\\pipe\\${path}`; | ||
} | ||
client.socket = net.connect( | ||
{ | ||
path: path | ||
} | ||
); | ||
client.socket = net.connect(options); | ||
}else{ | ||
options.host=client.path; | ||
options.port=client.port; | ||
if(client.config.interface.localAddress){ | ||
options.localAddress=client.config.interface.localAddress; | ||
} | ||
if(client.config.interface.localPort){ | ||
options.localPort=client.config.interface.localPort; | ||
} | ||
if(client.config.interface.family){ | ||
options.family=client.config.interface.family; | ||
} | ||
if(client.config.interface.hints){ | ||
options.hints=client.config.interface.hints; | ||
} | ||
if(client.config.interface.lookup){ | ||
options.lookup=client.config.interface.lookup; | ||
} | ||
if(!client.config.tls){ | ||
client.log('Connecting client via TCP to', client.path ,client.port); | ||
client.socket = net.connect( | ||
{ | ||
port:client.port, | ||
host:client.path | ||
} | ||
); | ||
client.log('Connecting client via TCP to', options); | ||
client.socket = net.connect(options); | ||
}else{ | ||
@@ -118,4 +135,3 @@ client.log('Connecting client via TLS to', client.path ,client.port,client.config.tls); | ||
client.config.tls.host=client.path; | ||
client.config.tls.port=client.port; | ||
Object.assign(client.config.tls,options); | ||
@@ -122,0 +138,0 @@ client.socket = tls.connect( |
@@ -72,3 +72,3 @@ 'use strict'; | ||
if(this.config.rawBuffer){ | ||
console.log(this.config.encoding) | ||
this.log(this.config.encoding) | ||
message=new Buffer(type,this.config.encoding); | ||
@@ -264,4 +264,4 @@ }else{ | ||
if(!this.udp4 && !this.udp6){ | ||
this.log('starting TLS server',this.config.tls); | ||
if(!this.config.tls){ | ||
this.log('starting TCP server',this.config.tls); | ||
this.server=net.createServer( | ||
@@ -268,0 +268,0 @@ serverCreated.bind(this) |
@@ -24,94 +24,31 @@ 'use strict'; | ||
Object.defineProperties( | ||
this, | ||
{ | ||
appspace : { | ||
enumerable:true, | ||
writable:true, | ||
value:'app.' | ||
}, | ||
socketRoot : { | ||
enumerable:true, | ||
writable:true, | ||
value:'/tmp/' | ||
}, | ||
networkHost : { | ||
enumerable:true, | ||
writable:true, | ||
value: '' | ||
}, | ||
networkPort : { | ||
enumerable:true, | ||
writable:true, | ||
value:8000 | ||
}, | ||
id : { | ||
enumerable:true, | ||
writable:true, | ||
value:os.hostname() | ||
}, | ||
encoding : { | ||
enumerable:true, | ||
writable:true, | ||
value:'utf8' | ||
}, | ||
rawBuffer : { | ||
enumerable:true, | ||
writable:true, | ||
value:false | ||
}, | ||
sync : { | ||
enumerable:true, | ||
writable:true, | ||
value:false | ||
}, | ||
silent : { | ||
enumerable:true, | ||
writable:true, | ||
value:false | ||
}, | ||
logDepth:{ | ||
enumerable:true, | ||
writable:true, | ||
value:5 | ||
}, | ||
logInColor:{ | ||
enumerable:true, | ||
writable:true, | ||
value:true | ||
}, | ||
maxConnections : { | ||
enumerable:true, | ||
writable:true, | ||
value:100 | ||
}, | ||
retry : { | ||
enumerable:true, | ||
writable:true, | ||
value:500 | ||
}, | ||
maxRetries : { | ||
enumerable:true, | ||
writable:true, | ||
value:Infinity | ||
}, | ||
stopRetrying : { | ||
enumerable:true, | ||
writable:true, | ||
value:false | ||
}, | ||
IPType : { | ||
enumerable:true, | ||
writable:true, | ||
value: getIPType() | ||
}, | ||
tls : { | ||
enumerable:true, | ||
writable:true, | ||
value:false | ||
} | ||
} | ||
); | ||
this.appspace='app.'; | ||
this.socketRoot='/tmp/'; | ||
this.id=os.hostname(); | ||
this.encoding='utf8'; | ||
this.rawBuffer=false; | ||
this.sync=false; | ||
this.silent=false; | ||
this.logDepth=5; | ||
this.logInColor=true; | ||
this.maxConnections=100; | ||
this.retry=500; | ||
this.maxRetries=Infinity; | ||
this.stopRetrying=false; | ||
this.IPType=getIPType(); | ||
this.tls=false; | ||
this.networkHost = (this.IPType == 'IPv6') ? '::1' : '127.0.0.1'; | ||
this.networkPort = 8000; | ||
this.interface={ | ||
localAddress:false, | ||
localPort:false, | ||
family:false, | ||
hints:false, | ||
lookup:false | ||
} | ||
} | ||
@@ -118,0 +55,0 @@ } |
const ipc=require('../../../node-ipc'); | ||
/***************************************\ | ||
* | ||
* | ||
* You should start both hello and world | ||
* then you will see them communicating. | ||
* | ||
* | ||
* *************************************/ | ||
@@ -40,3 +40,1 @@ | ||
); | ||
console.log(ipc); |
@@ -31,3 +31,3 @@ const ipc=require('../../../node-ipc'); | ||
function(data,socket){ | ||
console.log(arguments); | ||
console.log('DISCONNECTED\n\n',arguments); | ||
} | ||
@@ -34,0 +34,0 @@ ); |
{ | ||
"name": "node-ipc", | ||
"version": "8.9.3", | ||
"version": "8.10.0", | ||
"description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.", | ||
@@ -16,4 +16,4 @@ "main": "node-ipc.js", | ||
"js-message": ">=1.0.5", | ||
"js-queue": ">=1.0.0", | ||
"node-cmd": ">=1.1.1" | ||
"js-queue": ">=2.0.0", | ||
"node-cmd": ">=1.2.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
@@ -108,3 +108,10 @@ node-ipc | ||
maxRetries : false, | ||
stopRetrying : false | ||
stopRetrying : false, | ||
interfaces : { | ||
localAddress: false, | ||
localPort : false, | ||
family : false, | ||
hints : false, | ||
lookup : false | ||
} | ||
} | ||
@@ -131,2 +138,3 @@ | ||
| stopRetrying| Defaults to false meaning clients will continue to retry to connect to servers indefinitely at the retry interval. If set to any number the client will stop retrying when that number is exceeded after each disconnect. If set to true in real time it will immediately stop trying to connect regardless of maxRetries. If set to 0, the client will ***NOT*** try to reconnect. | | ||
| interfaces| primarily used when specifying which interface a client should connect through. see the [socket.connect documentation in the node.js api](https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener) | | ||
@@ -133,0 +141,0 @@ ---- |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
792
126249
2623
1
Updatedjs-queue@>=2.0.0
Updatednode-cmd@>=1.2.0