fixed some formatting
This commit is contained in:
parent
143e23ca4d
commit
9f1755374a
3 changed files with 17 additions and 11 deletions
|
@ -70,7 +70,7 @@ function connect(){
|
|||
if (process.platform ==='win32' && !client.path.startsWith('\\\\.\\pipe\\')){
|
||||
path = path.replace(/^\//, '');
|
||||
path = path.replace(/\//g, '-');
|
||||
path= '\\\\.\\pipe\\'+path;
|
||||
path= `\\\\.\\pipe\\${path}`;
|
||||
}
|
||||
client.socket = net.connect(
|
||||
{
|
||||
|
@ -138,7 +138,9 @@ function connect(){
|
|||
client.socket.on(
|
||||
'close',
|
||||
function connectionClosed(){
|
||||
client.log('connection closed'.notice ,client.id.variable , client.path.variable, client.retriesRemaining+' tries remaining of '+client.config.maxRetries);
|
||||
client.log('connection closed'.notice ,client.id.variable , client.path.variable,
|
||||
`${client.retriesRemaining} tries remaining of ${client.config.maxRetries}`
|
||||
);
|
||||
|
||||
if(
|
||||
client.config.stopRetrying || client.retriesRemaining<1
|
||||
|
|
|
@ -4,7 +4,7 @@ const net = require('net'),
|
|||
tls = require('tls'),
|
||||
fs = require('fs'),
|
||||
dgram = require('dgram'),
|
||||
eventParser = require('./eventParser.js'),
|
||||
eventParser = require('../lib/eventParser.js'),
|
||||
Pubsub = require('event-pubsub'),
|
||||
Message = require('js-message');
|
||||
|
||||
|
@ -92,7 +92,10 @@ function init(path,config,log,port){
|
|||
fs.unlink(
|
||||
this.path,
|
||||
function () {
|
||||
server.log('starting server on '.debug,server.path.variable,((server.port)?':'+server.port:'').variable);
|
||||
server.log(
|
||||
'starting server on '.debug,server.path.variable,
|
||||
((server.port)?`:${server.port}`:'').variable
|
||||
);
|
||||
|
||||
if(!server.udp4 && !server.udp6){
|
||||
if(!server.config.tls){
|
||||
|
@ -104,12 +107,12 @@ function init(path,config,log,port){
|
|||
if(server.config.tls.private){
|
||||
server.config.tls.key=fs.readFileSync(server.config.tls.private);
|
||||
}else{
|
||||
server.config.tls.key=fs.readFileSync(__dirname+'/../local-node-ipc-certs/private/server.key');
|
||||
server.config.tls.key=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/private/server.key`);
|
||||
}
|
||||
if(server.config.tls.public){
|
||||
server.config.tls.cert=fs.readFileSync(server.config.tls.public);
|
||||
}else{
|
||||
server.config.tls.cert=fs.readFileSync(__dirname+'/../local-node-ipc-certs/server.pub');
|
||||
server.config.tls.cert=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/server.pub`);
|
||||
}
|
||||
if(server.config.tls.dhparam){
|
||||
server.config.tls.dhparam=fs.readFileSync(server.config.tls.dhparam);
|
||||
|
@ -291,7 +294,7 @@ function init(path,config,log,port){
|
|||
if (process.platform ==='win32'){
|
||||
server.path = server.path.replace(/^\//, '');
|
||||
server.path = server.path.replace(/\//g, '-');
|
||||
server.path= '\\\\.\\pipe\\'+server.path;
|
||||
server.path= `\\\\.\\pipe\\${server.path}`;
|
||||
}
|
||||
|
||||
server.server.listen(
|
||||
|
@ -348,7 +351,7 @@ function init(path,config,log,port){
|
|||
destroyedSocketId=socket.id;
|
||||
}
|
||||
|
||||
server.log('socket disconnected'.notice,' '+destroyedSocketId.variable);
|
||||
server.log('socket disconnected'.notice,destroyedSocketId.toString().variable);
|
||||
|
||||
if(socket && socket.destroy){
|
||||
socket.destroy();
|
||||
|
|
|
@ -7,6 +7,7 @@ const colors = require('colors'),
|
|||
class IPCModule extends IPC{
|
||||
constructor(){
|
||||
super();
|
||||
//include IPC to make extensible
|
||||
Object.defineProperty(
|
||||
this,
|
||||
'IPC',
|
||||
|
|
Loading…
Reference in a new issue