new event pubsub support

This commit is contained in:
SSMP 2016-09-30 06:00:28 -07:00
parent 6c01ffc0b7
commit 49b631b270
21 changed files with 1334 additions and 1249 deletions

View file

@ -3,26 +3,29 @@
const net = require('net'), const net = require('net'),
tls = require('tls'), tls = require('tls'),
eventParser = require('./eventParser.js'), eventParser = require('./eventParser.js'),
Pubsub = require('event-pubsub'), Events = require('event-pubsub'),
Message = require('js-message'), Message = require('js-message'),
fs = require('fs'), fs = require('fs'),
Queue = require('js-queue'); Queue = require('js-queue');
function init(config,log){ class Client extends Events{
let client={ constructor(config,log){
config : config, super();
queue : new Queue, Object.assign(
socket : false, this,
connect : connect, {
emit : emit, Client : Client,
log : log, config : config,
retriesRemaining:config.maxRetries||0, queue : new Queue,
explicitlyDisconnected: false socket : false,
}; connect : connect,
emit : emit,
new Pubsub(client); log : log,
retriesRemaining:config.maxRetries||0,
return client; explicitlyDisconnected: false
}
);
}
} }
function emit(type,data){ function emit(type,data){
@ -122,7 +125,7 @@ function connect(){
'error', 'error',
function(err){ function(err){
client.log('\n\n######\nerror: ', err); client.log('\n\n######\nerror: ', err);
client.trigger('error', err); client.publish('error', err);
} }
); );
@ -130,7 +133,7 @@ function connect(){
client.socket.on( client.socket.on(
'connect', 'connect',
function connectionMade(){ function connectionMade(){
client.trigger('connect'); client.publish('connect');
client.retriesRemaining=client.config.maxRetries; client.retriesRemaining=client.config.maxRetries;
client.log('retrying reset'); client.log('retrying reset');
} }
@ -149,7 +152,7 @@ function connect(){
client.explicitlyDisconnected client.explicitlyDisconnected
){ ){
client.trigger('disconnect'); client.publish('disconnect');
client.log( client.log(
(client.config.id), (client.config.id),
'exceeded connection rety amount of', 'exceeded connection rety amount of',
@ -157,7 +160,7 @@ function connect(){
); );
client.socket.destroy(); client.socket.destroy();
client.trigger('destroy'); client.publish('destroy');
client=undefined; client=undefined;
return; return;
@ -171,7 +174,7 @@ function connect(){
client.config.retry client.config.retry
); );
client.trigger('disconnect'); client.publish('disconnect');
} }
); );
@ -180,7 +183,7 @@ function connect(){
function(data) { function(data) {
client.log('## received events ##'); client.log('## received events ##');
if(client.config.rawBuffer){ if(client.config.rawBuffer){
client.trigger( client.publish(
'data', 'data',
new Buffer(data,client.config.encoding) new Buffer(data,client.config.encoding)
); );
@ -212,7 +215,7 @@ function connect(){
message.load(events[i]); message.load(events[i]);
client.log('detected event', message.type, message.data); client.log('detected event', message.type, message.data);
client.trigger( client.publish(
message.type, message.type,
message.data message.data
); );
@ -227,4 +230,4 @@ function connect(){
); );
} }
module.exports=init; module.exports=Client;

View file

@ -5,9 +5,58 @@ const net = require('net'),
fs = require('fs'), fs = require('fs'),
dgram = require('dgram'), dgram = require('dgram'),
eventParser = require('./eventParser.js'), eventParser = require('./eventParser.js'),
Pubsub = require('event-pubsub'), Events = require('event-pubsub'),
Message = require('js-message'); Message = require('js-message');
class Server extends Events{
constructor(path,config,log,port){
super();
Object.assign(
this,
{
config : config,
path : path,
port : port,
udp4 : false,
udp6 : false,
log : log,
server : false,
sockets : [],
emit : emit,
broadcast : broadcast
}
);
this.on(
'close',
serverClosed.bind(this)
);
}
onStart(socket){
this.trigger(
'start',
socket
);
}
stop(){
this.server.close();
}
start(){
if(!this.path){
this.log('Socket Server Path not specified, refusing to start');
return;
}
fs.unlink(
this.path,
startServer.bind(this)
);
}
}
function emit(socket, type, data){ function emit(socket, type, data){
this.log('dispatching event to socket', ' : ', type, data); this.log('dispatching event to socket', ' : ', type, data);
@ -63,312 +112,278 @@ function broadcast(type,data){
} }
} }
function init(path,config,log,port){ function serverClosed(){
let server={ for(let i=0, count=this.sockets.length; i<count; i++){
config : config, let socket=this.sockets[i];
path : path, let destroyedSocketId=false;
port : port,
udp4 : false, if(socket){
udp6 : false, if(socket.readable){
log : log, continue;
server : false,
sockets : [],
emit : emit,
broadcast : broadcast,
onStart : function onStart(socket){
this.trigger(
'start',
socket
);
},
stop:function stop(){
server.server.close();
},
start : function start(){
if(!this.path){
server.log('Socket Server Path not specified, refusing to start');
return;
} }
fs.unlink(
this.path,
function () {
server.log(
'starting server on ',server.path,
((server.port)?`:${server.port}`:'')
);
if(!server.udp4 && !server.udp6){
if(!server.config.tls){
server.server=net.createServer(
serverCreated
);
}else{
server.log('starting TLS server',server.config.tls);
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`);
}
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`);
}
if(server.config.tls.dhparam){
server.config.tls.dhparam=fs.readFileSync(server.config.tls.dhparam);
}
if(server.config.tls.trustedConnections){
if(typeof server.config.tls.trustedConnections === 'string'){
server.config.tls.trustedConnections=[server.config.tls.trustedConnections];
}
server.config.tls.ca=[];
for(let i=0; i<server.config.tls.trustedConnections.length; i++){
server.config.tls.ca.push(
fs.readFileSync(server.config.tls.trustedConnections[i])
);
}
}
server.server=tls.createServer(
server.config.tls,
serverCreated
);
}
}else{
function UDPWrite(message,socket){
let data=new Buffer(message, server.config.encoding);
server.server.send(
data,
0,
data.length,
socket.port,
socket.address,
function(err, bytes) {
if(err){
server.log('error writing data to socket',err);
server.trigger(
'error',
function(err){
server.trigger('error',err);
}
);
}
}
);
}
server.server=dgram.createSocket(
((server.udp4)? 'udp4':'udp6')
);
server.server.write=UDPWrite;
server.server.on(
'listening',
function () {
serverCreated(server.server);
}
);
}
server.server.on(
'error',
function(err){
server.log('server error',err);
server.trigger(
'error',
err
);
}
);
server.server.maxConnections=server.config.maxConnections;
function serverCreated(socket) {
server.sockets.push(socket);
if(socket.setEncoding){
socket.setEncoding(server.config.encoding);
}
server.log('## socket connection to server detected ##');
socket.on(
'close',
function(socket){
server.trigger(
'close',
socket
);
}
);
socket.on(
'error',
function(err){
server.log('server socket error',err);
server.trigger('error',err);
}
);
socket.on(
'data',
function(data,UDPSocket){
let sock=((server.udp4 || server.udp6)? UDPSocket : socket);
if(server.config.rawBuffer){
data=new Buffer(data,server.config.encoding);
server.trigger(
'data',
data,
sock
);
return;
}
if(!this.ipcBuffer){
this.ipcBuffer='';
}
data=(this.ipcBuffer+=data);
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){
server.log('Messages are large, You may want to consider smaller messages.');
return;
}
this.ipcBuffer='';
data=eventParser.parse(data);
while(data.length>0){
let message=new Message;
message.load(data.shift());
server.log('received event of : ',message.type,message.data);
if(message.data.id){
sock.id=message.data.id;
}
server.trigger(
message.type,
message.data,
sock
);
}
}
);
socket.on(
'message',
function(msg,rinfo) {
if (!rinfo){
return;
}
server.log('Received UDP message from ', rinfo.address, rinfo.port);
let data;
if(server.config.rawSocket){
data=new Buffer(msg,server.config.encoding);
}else{
data=msg.toString();
}
socket.emit('data',data,rinfo);
}
);
server.trigger(
'connect',
socket
);
if(server.config.rawBuffer){
return;
}
}
function started(socket){
server.onStart(socket);
}
if(!port){
server.log('starting server as', 'Unix || Windows Socket');
if (process.platform ==='win32'){
server.path = server.path.replace(/^\//, '');
server.path = server.path.replace(/\//g, '-');
server.path= `\\\\.\\pipe\\${server.path}`;
}
server.server.listen(
server.path,
started
);
return;
}
if(!server.udp4 && !server.udp6){
server.log('starting server as', (server.config.tls?'TLS':'TCP'));
server.server.listen(
server.port,
server.path,
started
);
return;
}
server.log('starting server as',((server.udp4)? 'udp4':'udp6'));
server.server.bind(
server.port,
server.path
);
started(
{
address : server.path,
port : server.port
}
);
}
);
} }
};
new Pubsub(server); if(socket.id){
destroyedSocketId=socket.id;
}
server.on( this.log('socket disconnected',destroyedSocketId.toString());
if(socket && socket.destroy){
socket.destroy();
}
this.sockets.splice(i,1);
this.publish('socket.disconnected', socket, destroyedSocketId);
return;
}
}
function gotData(socket,data,UDPSocket){
let sock=((this.udp4 || this.udp6)? UDPSocket : socket);
if(this.config.rawBuffer){
data=new Buffer(data,this.config.encoding);
this.publish(
'data',
data,
sock
);
return;
}
if(!this.ipcBuffer){
this.ipcBuffer='';
}
data=(this.ipcBuffer+=data);
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){
this.log('Messages are large, You may want to consider smaller messages.');
return;
}
this.ipcBuffer='';
data=eventParser.parse(data);
while(data.length>0){
let message=new Message;
message.load(data.shift());
this.log('received event of : ',message.type,message.data);
if(message.data.id){
sock.id=message.data.id;
}
this.publish(
message.type,
message.data,
sock
);
}
}
function socketClosed(socket){
this.publish(
'close', 'close',
function(){ socket
for(let i=0, count=server.sockets.length; i<count; i++){ );
let socket=server.sockets[i]; }
let destroyedSocketId=false;
if(socket){ function serverCreated(socket) {
if(socket.readable){ this.sockets.push(socket);
continue;
}
}
if(socket.id){ if(socket.setEncoding){
destroyedSocketId=socket.id; socket.setEncoding(this.config.encoding);
} }
server.log('socket disconnected',destroyedSocketId.toString()); this.log('## socket connection to server detected ##');
socket.on(
'close',
socketClosed.bind(this)
);
if(socket && socket.destroy){ socket.on(
socket.destroy(); 'error',
} function(err){
this.log('server socket error',err);
server.sockets.splice(i,1); this.publish('error',err);
}.bind(this)
);
server.trigger('socket.disconnected', socket, destroyedSocketId); socket.on(
'data',
gotData.bind(this,socket)
);
socket.on(
'message',
function(msg,rinfo) {
if (!rinfo){
return; return;
} }
this.log('Received UDP message from ', rinfo.address, rinfo.port);
let data;
if(this.config.rawSocket){
data=new Buffer(msg,this.config.encoding);
}else{
data=msg.toString();
}
socket.emit('data',data,rinfo);
}.bind(this)
);
this.publish(
'connect',
socket
);
if(this.config.rawBuffer){
return;
}
}
function startServer() {
this.log(
'starting server on ',this.path,
((this.port)?`:${this.port}`:'')
);
if(!this.udp4 && !this.udp6){
if(!this.config.tls){
this.log('starting TCP server',this.config.tls);
this.server=net.createServer(
serverCreated.bind(this)
);
}else{
startTLSServer.bind(this);
}
}else{
this.server=dgram.createSocket(
((this.udp4)? 'udp4':'udp6')
);
this.server.write=UDPWrite.bind(this);
this.server.on(
'listening',
function UDPServerStarted() {
serverCreated.bind(this)(this.server);
}.bind(this)
);
}
this.server.on(
'error',
function(err){
this.log('server error',err);
this.publish(
'error',
err
);
} }
); );
return server; this.server.maxConnections=this.config.maxConnections;
if(!this.port){
this.log('starting server as', 'Unix || Windows Socket');
if (process.platform ==='win32'){
this.path = this.path.replace(/^\//, '');
this.path = this.path.replace(/\//g, '-');
this.path= `\\\\.\\pipe\\${this.path}`;
}
this.server.listen(
this.path,
this.onStart.bind(this)
);
return;
}
if(!this.udp4 && !this.udp6){
this.log('starting server as', (this.config.tls?'TLS':'TCP'));
this.server.listen(
this.port,
this.path,
this.onStart.bind(this)
);
return;
}
this.log('starting server as',((this.udp4)? 'udp4':'udp6'));
this.server.bind(
this.port,
this.path
);
this.onStart(
{
address : this.path,
port : this.port
}
);
} }
module.exports=init; function startTLSServer(){
this.log('starting TLS server',this.config.tls);
if(this.config.tls.private){
this.config.tls.key=fs.readFileSync(this.config.tls.private);
}else{
this.config.tls.key=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/private/server.key`);
}
if(this.config.tls.public){
this.config.tls.cert=fs.readFileSync(this.config.tls.public);
}else{
this.config.tls.cert=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/server.pub`);
}
if(this.config.tls.dhparam){
this.config.tls.dhparam=fs.readFileSync(this.config.tls.dhparam);
}
if(this.config.tls.trustedConnections){
if(typeof this.config.tls.trustedConnections === 'string'){
this.config.tls.trustedConnections=[this.config.tls.trustedConnections];
}
this.config.tls.ca=[];
for(let i=0; i<this.config.tls.trustedConnections.length; i++){
this.config.tls.ca.push(
fs.readFileSync(this.config.tls.trustedConnections[i])
);
}
}
this.server=tls.createServer(
this.config.tls,
serverCreated.bind(this)
);
}
function UDPWrite(message,socket){
let data=new Buffer(message, this.config.encoding);
this.server.send(
data,
0,
data.length,
socket.port,
socket.address,
function(err, bytes) {
if(err){
this.log('error writing data to socket',err);
this.publish(
'error',
function(err){
this.publish('error',err);
}
);
}
}
);
}
module.exports=Server;

View file

@ -1,6 +1,6 @@
{ {
"name": "node-ipc", "name": "node-ipc",
"version": "8.2.0", "version": "8.8.0",
"description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.", "description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.",
"main": "node-ipc.js", "main": "node-ipc.js",
"directories": { "directories": {
@ -11,7 +11,7 @@
}, },
"dependencies": { "dependencies": {
"colors": "*", "colors": "*",
"event-pubsub": ">=2.1.2", "event-pubsub": ">=4.0.0",
"js-message": ">=1.0.5", "js-message": ">=1.0.5",
"js-queue": ">=1.0.0", "js-queue": ">=1.0.0",
"node-cmd": ">=1.1.1" "node-cmd": ">=1.1.1"

File diff suppressed because one or more lines are too long

View file

@ -20,9 +20,9 @@
</h1> </h1>
<div class='clearfix'> <div class='clearfix'>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">67.48% </span> <span class="strong">67.31% </span>
<span class="quiet">Statements</span> <span class="quiet">Statements</span>
<span class='fraction'>278/412</span> <span class='fraction'>278/413</span>
</div> </div>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">56.28% </span> <span class="strong">56.28% </span>
@ -30,14 +30,14 @@
<span class='fraction'>121/215</span> <span class='fraction'>121/215</span>
</div> </div>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">87.8% </span> <span class="strong">85.37% </span>
<span class="quiet">Functions</span> <span class="quiet">Functions</span>
<span class='fraction'>36/41</span> <span class='fraction'>35/41</span>
</div> </div>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">67.48% </span> <span class="strong">67.31% </span>
<span class="quiet">Lines</span> <span class="quiet">Lines</span>
<span class='fraction'>278/412</span> <span class='fraction'>278/413</span>
</div> </div>
</div> </div>
</div> </div>
@ -73,15 +73,15 @@
<tr> <tr>
<td class="file medium" data-value="node-ipc/dao/"><a href="node-ipc/dao/index.html">node-ipc/dao/</a></td> <td class="file medium" data-value="node-ipc/dao/"><a href="node-ipc/dao/index.html">node-ipc/dao/</a></td>
<td data-value="66.92" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 66%;"></div><div class="cover-empty" style="width:34%;"></div></div></td> <td data-value="66.67" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 66%;"></div><div class="cover-empty" style="width:34%;"></div></div></td>
<td data-value="66.92" class="pct medium">66.92%</td> <td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="263" class="abs medium">176/263</td> <td data-value="264" class="abs medium">176/264</td>
<td data-value="53.73" class="pct medium">53.73%</td> <td data-value="53.73" class="pct medium">53.73%</td>
<td data-value="134" class="abs medium">72/134</td> <td data-value="134" class="abs medium">72/134</td>
<td data-value="86.67" class="pct high">86.67%</td> <td data-value="83.33" class="pct high">83.33%</td>
<td data-value="30" class="abs high">26/30</td> <td data-value="30" class="abs high">25/30</td>
<td data-value="66.92" class="pct medium">66.92%</td> <td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="263" class="abs medium">176/263</td> <td data-value="264" class="abs medium">176/264</td>
</tr> </tr>
<tr> <tr>
@ -116,7 +116,7 @@
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="prettify.js"></script> <script src="prettify.js"></script>

View file

@ -20,9 +20,9 @@
</h1> </h1>
<div class='clearfix'> <div class='clearfix'>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">71.43% </span> <span class="strong">70.83% </span>
<span class="quiet">Statements</span> <span class="quiet">Statements</span>
<span class='fraction'>70/98</span> <span class='fraction'>68/96</span>
</div> </div>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">51.22% </span> <span class="strong">51.22% </span>
@ -35,9 +35,9 @@
<span class='fraction'>9/9</span> <span class='fraction'>9/9</span>
</div> </div>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">71.43% </span> <span class="strong">70.83% </span>
<span class="quiet">Lines</span> <span class="quiet">Lines</span>
<span class='fraction'>70/98</span> <span class='fraction'>68/96</span>
</div> </div>
</div> </div>
</div> </div>
@ -273,7 +273,10 @@
228 228
229 229
230 230
231</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span> 231
232
233
234</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
@ -283,7 +286,9 @@
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span> <span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
@ -295,9 +300,10 @@
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span>
@ -508,26 +514,29 @@
const net = require('net'), const net = require('net'),
tls = require('tls'), tls = require('tls'),
eventParser = require('./eventParser.js'), eventParser = require('./eventParser.js'),
Pubsub = require('event-pubsub'), Events = require('event-pubsub'),
Message = require('js-message'), Message = require('js-message'),
fs = require('fs'), fs = require('fs'),
Queue = require('js-queue'); Queue = require('js-queue');
&nbsp; &nbsp;
function init(config,log){ class Client extends Events{
let client={ constructor(config,log){
config : config, super();
queue : new Queue, Object.assign(
socket : false, this,
connect : connect, {
emit : emit, Client : Client,
log : log, config : config,
retriesRemaining:config.maxRetries||<span class="branch-1 cbranch-no" title="branch not covered" >0,</span> queue : new Queue,
explicitlyDisconnected: false socket : false,
}; connect : connect,
&nbsp; emit : emit,
new Pubsub(client); log : log,
&nbsp; retriesRemaining:config.maxRetries||<span class="branch-1 cbranch-no" title="branch not covered" >0,</span>
return client; explicitlyDisconnected: false
}
);
}
} }
&nbsp; &nbsp;
function emit(type,data){ function emit(type,data){
@ -627,7 +636,7 @@ function connect(){
'error', 'error',
function(err){ function(err){
client.log('\n\n######\nerror: ', err); client.log('\n\n######\nerror: ', err);
client.trigger('error', err); client.publish('error', err);
&nbsp; &nbsp;
} }
); );
@ -635,7 +644,7 @@ function connect(){
client.socket.on( client.socket.on(
'connect', 'connect',
function connectionMade(){ function connectionMade(){
client.trigger('connect'); client.publish('connect');
client.retriesRemaining=client.config.maxRetries; client.retriesRemaining=client.config.maxRetries;
client.log('retrying reset'); client.log('retrying reset');
} }
@ -654,7 +663,7 @@ function connect(){
client.explicitlyDisconnected client.explicitlyDisconnected
&nbsp; &nbsp;
){ ){
client.trigger('disconnect'); client.publish('disconnect');
client.log( client.log(
(client.config.id), (client.config.id),
'exceeded connection rety amount of', 'exceeded connection rety amount of',
@ -662,7 +671,7 @@ function connect(){
); );
&nbsp; &nbsp;
client.socket.destroy(); client.socket.destroy();
client.trigger('destroy'); client.publish('destroy');
client=undefined; client=undefined;
&nbsp; &nbsp;
return; return;
@ -676,7 +685,7 @@ function connect(){
client.config.retry client.config.retry
); );
&nbsp; &nbsp;
client.trigger('disconnect'); client.publish('disconnect');
} }
); );
&nbsp; &nbsp;
@ -685,7 +694,7 @@ function connect(){
function(data) { function(data) {
client.log('## received events ##'); client.log('## received events ##');
<span class="missing-if-branch" title="if path not taken" >I</span>if(client.config.rawBuffer){ <span class="missing-if-branch" title="if path not taken" >I</span>if(client.config.rawBuffer){
<span class="cstat-no" title="statement not covered" > client.trigger(</span> <span class="cstat-no" title="statement not covered" > client.publish(</span>
'data', 'data',
new Buffer(data,client.config.encoding) new Buffer(data,client.config.encoding)
); );
@ -717,7 +726,7 @@ function connect(){
message.load(events[i]); message.load(events[i]);
&nbsp; &nbsp;
client.log('detected event', message.type, message.data); client.log('detected event', message.type, message.data);
client.trigger( client.publish(
message.type, message.type,
message.data message.data
); );
@ -732,14 +741,14 @@ function connect(){
); );
} }
&nbsp; &nbsp;
module.exports=init; module.exports=Client;
&nbsp;</pre></td></tr> &nbsp;</pre></td></tr>
</table></pre> </table></pre>
<div class='push'></div><!-- for sticky footer --> <div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../../prettify.js"></script> <script src="../../prettify.js"></script>

View file

@ -130,7 +130,7 @@ module.exports=parser;
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../../prettify.js"></script> <script src="../../prettify.js"></script>

View file

@ -20,9 +20,9 @@
</h1> </h1>
<div class='clearfix'> <div class='clearfix'>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">66.92% </span> <span class="strong">66.67% </span>
<span class="quiet">Statements</span> <span class="quiet">Statements</span>
<span class='fraction'>176/263</span> <span class='fraction'>176/264</span>
</div> </div>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">53.73% </span> <span class="strong">53.73% </span>
@ -30,14 +30,14 @@
<span class='fraction'>72/134</span> <span class='fraction'>72/134</span>
</div> </div>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">86.67% </span> <span class="strong">83.33% </span>
<span class="quiet">Functions</span> <span class="quiet">Functions</span>
<span class='fraction'>26/30</span> <span class='fraction'>25/30</span>
</div> </div>
<div class='fl pad1y space-right2'> <div class='fl pad1y space-right2'>
<span class="strong">66.92% </span> <span class="strong">66.67% </span>
<span class="quiet">Lines</span> <span class="quiet">Lines</span>
<span class='fraction'>176/263</span> <span class='fraction'>176/264</span>
</div> </div>
</div> </div>
</div> </div>
@ -60,15 +60,15 @@
</thead> </thead>
<tbody><tr> <tbody><tr>
<td class="file medium" data-value="client.js"><a href="client.js.html">client.js</a></td> <td class="file medium" data-value="client.js"><a href="client.js.html">client.js</a></td>
<td data-value="71.43" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 71%;"></div><div class="cover-empty" style="width:29%;"></div></div></td> <td data-value="70.83" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 70%;"></div><div class="cover-empty" style="width:30%;"></div></div></td>
<td data-value="71.43" class="pct medium">71.43%</td> <td data-value="70.83" class="pct medium">70.83%</td>
<td data-value="98" class="abs medium">70/98</td> <td data-value="96" class="abs medium">68/96</td>
<td data-value="51.22" class="pct medium">51.22%</td> <td data-value="51.22" class="pct medium">51.22%</td>
<td data-value="41" class="abs medium">21/41</td> <td data-value="41" class="abs medium">21/41</td>
<td data-value="100" class="pct high">100%</td> <td data-value="100" class="pct high">100%</td>
<td data-value="9" class="abs high">9/9</td> <td data-value="9" class="abs high">9/9</td>
<td data-value="71.43" class="pct medium">71.43%</td> <td data-value="70.83" class="pct medium">70.83%</td>
<td data-value="98" class="abs medium">70/98</td> <td data-value="96" class="abs medium">68/96</td>
</tr> </tr>
<tr> <tr>
@ -86,15 +86,15 @@
<tr> <tr>
<td class="file medium" data-value="socketServer.js"><a href="socketServer.js.html">socketServer.js</a></td> <td class="file medium" data-value="socketServer.js"><a href="socketServer.js.html">socketServer.js</a></td>
<td data-value="62.5" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 62%;"></div><div class="cover-empty" style="width:38%;"></div></div></td> <td data-value="62.58" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 62%;"></div><div class="cover-empty" style="width:38%;"></div></div></td>
<td data-value="62.5" class="pct medium">62.5%</td> <td data-value="62.58" class="pct medium">62.58%</td>
<td data-value="152" class="abs medium">95/152</td> <td data-value="155" class="abs medium">97/155</td>
<td data-value="55.81" class="pct medium">55.81%</td> <td data-value="55.81" class="pct medium">55.81%</td>
<td data-value="86" class="abs medium">48/86</td> <td data-value="86" class="abs medium">48/86</td>
<td data-value="78.95" class="pct medium">78.95%</td> <td data-value="73.68" class="pct medium">73.68%</td>
<td data-value="19" class="abs medium">15/19</td> <td data-value="19" class="abs medium">14/19</td>
<td data-value="62.5" class="pct medium">62.5%</td> <td data-value="62.58" class="pct medium">62.58%</td>
<td data-value="152" class="abs medium">95/152</td> <td data-value="155" class="abs medium">97/155</td>
</tr> </tr>
</tbody> </tbody>
@ -103,7 +103,7 @@
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../../prettify.js"></script> <script src="../../prettify.js"></script>

File diff suppressed because it is too large Load diff

View file

@ -466,7 +466,7 @@ module.exports=Defaults;
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../../prettify.js"></script> <script src="../../prettify.js"></script>

View file

@ -77,7 +77,7 @@
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../../prettify.js"></script> <script src="../../prettify.js"></script>

View file

@ -77,7 +77,7 @@
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../prettify.js"></script> <script src="../prettify.js"></script>

View file

@ -112,7 +112,7 @@ module.exports=new IPCModule;
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../prettify.js"></script> <script src="../prettify.js"></script>

View file

@ -445,15 +445,15 @@
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span> <span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">114×</span> <span class="cline-any cline-yes">116×</span>
<span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">114×</span> <span class="cline-any cline-yes">116×</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">114×</span> <span class="cline-any cline-yes">116×</span>
<span class="cline-any cline-yes">372×</span> <span class="cline-any cline-yes">376×</span>
<span class="cline-any cline-yes">344×</span> <span class="cline-any cline-yes">348×</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28×</span> <span class="cline-any cline-yes">28×</span>
@ -465,7 +465,7 @@
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">114×</span> <span class="cline-any cline-yes">116×</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span>
@ -1063,7 +1063,7 @@ module.exports=IPC;
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../../prettify.js"></script> <script src="../../prettify.js"></script>

View file

@ -77,7 +77,7 @@
</div><!-- /wrapper --> </div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'> <div class='footer quiet pad2 space-top1 center small'>
Code coverage Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Aug 12 2016 15:23:14 GMT-0700 (PDT) generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Fri Sep 30 2016 05:59:50 GMT-0700 (PDT)
</div> </div>
</div> </div>
<script src="../../prettify.js"></script> <script src="../../prettify.js"></script>

View file

@ -26,7 +26,7 @@ FN:267,connectNet
FNF:8 FNF:8
FNH:7 FNH:7
FNDA:1,(anonymous_1) FNDA:1,(anonymous_1)
FNDA:114,log FNDA:116,log
FNDA:7,disconnect FNDA:7,disconnect
FNDA:1,serve FNDA:1,serve
FNDA:0,emptyCallback FNDA:0,emptyCallback
@ -36,14 +36,14 @@ FNDA:3,connectNet
DA:3,1 DA:3,1
DA:10,1 DA:10,1
DA:64,1 DA:64,1
DA:65,114 DA:65,116
DA:66,0 DA:66,0
DA:69,114 DA:69,116
DA:71,114 DA:71,116
DA:72,372 DA:72,376
DA:73,344 DA:73,348
DA:76,28 DA:76,28
DA:85,114 DA:85,116
DA:90,1 DA:90,1
DA:91,7 DA:91,7
DA:92,0 DA:92,0
@ -171,8 +171,8 @@ DA:338,1
LF:135 LF:135
LH:89 LH:89
BRDA:65,1,0,0 BRDA:65,1,0,0
BRDA:65,1,1,114 BRDA:65,1,1,116
BRDA:72,2,0,344 BRDA:72,2,0,348
BRDA:72,2,1,28 BRDA:72,2,1,28
BRDA:91,3,0,0 BRDA:91,3,0,0
BRDA:91,3,1,7 BRDA:91,3,1,7
@ -279,18 +279,18 @@ BRH:4
end_of_record end_of_record
TN: TN:
SF:/home/ssmp/git/node-ipc/dao/client.js SF:/home/ssmp/git/node-ipc/dao/client.js
FN:11,init FN:12,(anonymous_1)
FN:28,emit FN:31,emit
FN:51,syncEmit FN:54,syncEmit
FN:56,connect FN:59,connect
FN:123,(anonymous_5) FN:126,(anonymous_5)
FN:132,connectionMade FN:135,connectionMade
FN:141,connectionClosed FN:144,connectionClosed
FN:167,retryTimeout FN:170,retryTimeout
FN:180,(anonymous_9) FN:183,(anonymous_9)
FNF:9 FNF:9
FNH:9 FNH:9
FNDA:7,init FNDA:7,(anonymous_1)
FNDA:7,emit FNDA:7,emit
FNDA:6,syncEmit FNDA:6,syncEmit
FNDA:13,connect FNDA:13,connect
@ -300,146 +300,144 @@ FNDA:13,connectionClosed
FNDA:6,retryTimeout FNDA:6,retryTimeout
FNDA:7,(anonymous_9) FNDA:7,(anonymous_9)
DA:3,1 DA:3,1
DA:11,1 DA:13,7
DA:12,7 DA:14,7
DA:23,7 DA:31,1
DA:25,7
DA:28,1
DA:29,7
DA:31,7
DA:32,7 DA:32,7
DA:33,7 DA:34,7
DA:35,7 DA:35,7
DA:36,0 DA:36,7
DA:38,7 DA:38,7
DA:39,0
DA:41,7 DA:41,7
DA:42,1 DA:44,7
DA:43,1 DA:45,1
DA:46,6 DA:46,1
DA:51,1 DA:49,6
DA:52,6 DA:54,1
DA:53,6 DA:55,6
DA:56,1 DA:56,6
DA:58,13 DA:59,1
DA:60,13
DA:61,13 DA:61,13
DA:62,0 DA:63,13
DA:63,0 DA:64,13
DA:66,13 DA:65,0
DA:67,7 DA:66,0
DA:69,7 DA:69,13
DA:71,7 DA:70,7
DA:72,0 DA:72,7
DA:73,0 DA:74,7
DA:74,0 DA:75,0
DA:76,7 DA:76,0
DA:82,6 DA:77,0
DA:83,6 DA:79,7
DA:84,6 DA:85,6
DA:91,0 DA:86,6
DA:92,0 DA:87,6
DA:93,0 DA:94,0
DA:95,0 DA:95,0
DA:96,0 DA:96,0
DA:98,0 DA:98,0
DA:99,0 DA:99,0
DA:100,0 DA:101,0
DA:102,0 DA:102,0
DA:103,0 DA:103,0
DA:104,0 DA:105,0
DA:110,0 DA:106,0
DA:111,0 DA:107,0
DA:113,0 DA:113,0
DA:119,13 DA:114,0
DA:121,13 DA:116,0
DA:124,10 DA:122,13
DA:125,10 DA:124,13
DA:130,13 DA:127,10
DA:133,3 DA:128,10
DA:134,3 DA:133,13
DA:135,3 DA:136,3
DA:139,13 DA:137,3
DA:138,3
DA:142,13 DA:142,13
DA:146,13 DA:145,13
DA:152,7 DA:149,13
DA:153,7 DA:155,7
DA:159,7 DA:156,7
DA:160,7 DA:162,7
DA:161,7
DA:163,7 DA:163,7
DA:166,6 DA:164,7
DA:168,6 DA:166,7
DA:169,6 DA:169,6
DA:174,6 DA:171,6
DA:178,13 DA:172,6
DA:181,7 DA:177,6
DA:182,7 DA:181,13
DA:183,0 DA:184,7
DA:187,0 DA:185,7
DA:188,0 DA:186,0
DA:190,0
DA:191,0 DA:191,0
DA:192,0 DA:194,0
DA:195,7 DA:195,0
DA:196,7 DA:198,7
DA:199,7 DA:199,7
DA:201,7 DA:202,7
DA:202,0 DA:204,7
DA:203,0 DA:205,0
DA:206,7 DA:206,0
DA:208,7
DA:209,7 DA:209,7
DA:210,7
DA:211,7 DA:211,7
DA:212,7 DA:212,7
DA:213,7
DA:214,7 DA:214,7
DA:215,7 DA:215,7
DA:221,7 DA:217,7
DA:222,0 DA:218,7
DA:225,7 DA:224,7
DA:230,1 DA:225,0
LF:98 DA:228,7
LH:70 DA:233,1
BRDA:19,1,0,7 LF:96
BRDA:19,1,1,0 LH:68
BRDA:35,2,0,0 BRDA:24,1,0,7
BRDA:35,2,1,7 BRDA:24,1,1,0
BRDA:41,3,0,1 BRDA:38,2,0,0
BRDA:41,3,1,6 BRDA:38,2,1,7
BRDA:61,4,0,0 BRDA:44,3,0,1
BRDA:61,4,1,13 BRDA:44,3,1,6
BRDA:66,5,0,7 BRDA:64,4,0,0
BRDA:66,5,1,6 BRDA:64,4,1,13
BRDA:71,6,0,0 BRDA:69,5,0,7
BRDA:71,6,1,7 BRDA:69,5,1,6
BRDA:71,7,0,7 BRDA:74,6,0,0
BRDA:71,7,1,0 BRDA:74,6,1,7
BRDA:82,8,0,6 BRDA:74,7,0,7
BRDA:82,8,1,0 BRDA:74,7,1,0
BRDA:92,9,0,0 BRDA:85,8,0,6
BRDA:92,9,1,0 BRDA:85,8,1,0
BRDA:95,10,0,0 BRDA:95,9,0,0
BRDA:95,10,1,0 BRDA:95,9,1,0
BRDA:98,11,0,0 BRDA:98,10,0,0
BRDA:98,11,1,0 BRDA:98,10,1,0
BRDA:99,12,0,0 BRDA:101,11,0,0
BRDA:99,12,1,0 BRDA:101,11,1,0
BRDA:146,13,0,7 BRDA:102,12,0,0
BRDA:146,13,1,6 BRDA:102,12,1,0
BRDA:147,14,0,13 BRDA:149,13,0,7
BRDA:147,14,1,8 BRDA:149,13,1,6
BRDA:147,14,2,6 BRDA:150,14,0,13
BRDA:182,15,0,0 BRDA:150,14,1,8
BRDA:182,15,1,7 BRDA:150,14,2,6
BRDA:187,16,0,0 BRDA:185,15,0,0
BRDA:187,16,1,0 BRDA:185,15,1,7
BRDA:195,17,0,7 BRDA:190,16,0,0
BRDA:195,17,1,0 BRDA:190,16,1,0
BRDA:201,18,0,0 BRDA:198,17,0,7
BRDA:201,18,1,7 BRDA:198,17,1,0
BRDA:201,19,0,7 BRDA:204,18,0,0
BRDA:201,19,1,7 BRDA:204,18,1,7
BRDA:221,20,0,0 BRDA:204,19,0,7
BRDA:221,20,1,7 BRDA:204,19,1,7
BRDA:224,20,0,0
BRDA:224,20,1,7
BRF:41 BRF:41
BRH:21 BRH:21
end_of_record end_of_record
@ -478,165 +476,161 @@ BRH:3
end_of_record end_of_record
TN: TN:
SF:/home/ssmp/git/node-ipc/dao/socketServer.js SF:/home/ssmp/git/node-ipc/dao/socketServer.js
FN:11,emit FN:12,(anonymous_1)
FN:43,broadcast FN:36,(anonymous_2)
FN:66,init FN:43,(anonymous_3)
FN:78,onStart FN:47,(anonymous_4)
FN:84,stop FN:60,emit
FN:87,start FN:92,broadcast
FN:95,(anonymous_7) FN:115,serverClosed
FN:138,UDPWrite FN:144,gotData
FN:146,(anonymous_9) FN:189,socketClosed
FN:151,(anonymous_10) FN:196,serverCreated
FN:166,(anonymous_11) FN:211,(anonymous_11)
FN:174,(anonymous_12) FN:225,(anonymous_12)
FN:186,serverCreated FN:252,startServer
FN:196,(anonymous_14) FN:274,UDPServerStarted
FN:206,(anonymous_15) FN:282,(anonymous_15)
FN:215,(anonymous_16) FN:335,startTLSServer
FN:263,(anonymous_17) FN:367,UDPWrite
FN:290,started FN:375,(anonymous_18)
FN:341,(anonymous_19) FN:380,(anonymous_19)
FNF:19 FNF:19
FNH:15 FNH:14
FNDA:4,(anonymous_1)
FNDA:4,(anonymous_2)
FNDA:4,(anonymous_3)
FNDA:4,(anonymous_4)
FNDA:2,emit FNDA:2,emit
FNDA:0,broadcast FNDA:0,broadcast
FNDA:4,init FNDA:2,serverClosed
FNDA:4,onStart FNDA:2,gotData
FNDA:4,stop FNDA:2,socketClosed
FNDA:4,start
FNDA:4,(anonymous_7)
FNDA:2,UDPWrite
FNDA:2,(anonymous_9)
FNDA:0,(anonymous_10)
FNDA:2,(anonymous_11)
FNDA:0,(anonymous_12)
FNDA:4,serverCreated FNDA:4,serverCreated
FNDA:2,(anonymous_14) FNDA:0,(anonymous_11)
FNDA:2,(anonymous_12)
FNDA:4,startServer
FNDA:2,UDPServerStarted
FNDA:0,(anonymous_15) FNDA:0,(anonymous_15)
FNDA:2,(anonymous_16) FNDA:0,startTLSServer
FNDA:2,(anonymous_17) FNDA:2,UDPWrite
FNDA:4,started FNDA:2,(anonymous_18)
FNDA:2,(anonymous_19) FNDA:0,(anonymous_19)
DA:3,1 DA:3,1
DA:11,1 DA:13,4
DA:12,2 DA:14,4
DA:14,2 DA:30,4
DA:15,2 DA:37,4
DA:16,2 DA:44,4
DA:18,2 DA:48,4
DA:19,0
DA:20,0
DA:22,2
DA:25,2
DA:27,2
DA:28,0
DA:29,0
DA:30,0
DA:33,2
DA:37,2
DA:40,0
DA:43,1
DA:44,0
DA:45,0
DA:46,0
DA:47,0
DA:49,0 DA:49,0
DA:50,0 DA:50,0
DA:52,0 DA:53,4
DA:55,0 DA:60,1
DA:56,0 DA:61,2
DA:57,0 DA:63,2
DA:60,0 DA:64,2
DA:61,0 DA:65,2
DA:66,1 DA:67,2
DA:67,4 DA:68,0
DA:79,4 DA:69,0
DA:85,4 DA:71,2
DA:88,4 DA:74,2
DA:76,2
DA:77,0
DA:78,0
DA:79,0
DA:82,2
DA:86,2
DA:89,0 DA:89,0
DA:90,0 DA:92,1
DA:93,4 DA:93,0
DA:96,4 DA:94,0
DA:101,4 DA:95,0
DA:102,2 DA:96,0
DA:103,2 DA:98,0
DA:107,0 DA:99,0
DA:108,0 DA:101,0
DA:104,0
DA:105,0
DA:106,0
DA:109,0 DA:109,0
DA:111,0 DA:110,0
DA:113,0 DA:115,1
DA:114,0 DA:116,2
DA:116,0 DA:117,2
DA:118,0 DA:118,2
DA:119,0 DA:120,2
DA:121,0 DA:121,2
DA:122,0 DA:122,0
DA:123,0 DA:126,2
DA:125,0
DA:126,0
DA:127,0 DA:127,0
DA:132,0 DA:130,2
DA:138,1 DA:132,2
DA:139,2 DA:133,0
DA:136,2
DA:138,2
DA:140,2 DA:140,2
DA:147,2 DA:144,1
DA:145,2
DA:146,2
DA:147,0
DA:148,0 DA:148,0
DA:149,0 DA:153,0
DA:152,0 DA:156,2
DA:157,2
DA:160,2 DA:160,2
DA:163,2 DA:162,2
DA:164,2 DA:163,0
DA:164,0
DA:167,2 DA:167,2
DA:172,4 DA:169,2
DA:175,0 DA:171,2
DA:177,0 DA:172,2
DA:184,4 DA:173,2
DA:186,1 DA:175,2
DA:187,4 DA:177,2
DA:189,4 DA:178,2
DA:181,2
DA:189,1
DA:190,2 DA:190,2
DA:193,4 DA:196,1
DA:194,4 DA:197,4
DA:197,2 DA:199,4
DA:200,2
DA:203,4
DA:204,4 DA:204,4
DA:207,0 DA:209,4
DA:209,0 DA:212,0
DA:213,4 DA:214,0
DA:216,2 DA:218,4
DA:217,2 DA:223,4
DA:218,0 DA:226,2
DA:219,0 DA:227,0
DA:224,0 DA:230,2
DA:227,2
DA:228,2
DA:231,2 DA:231,2
DA:233,2 DA:233,2
DA:234,0 DA:234,0
DA:235,0 DA:236,2
DA:238,2 DA:238,2
DA:240,2 DA:242,4
DA:242,2 DA:247,4
DA:243,2 DA:248,0
DA:244,2 DA:252,1
DA:246,2 DA:253,4
DA:248,2 DA:258,4
DA:249,2 DA:259,2
DA:252,2 DA:260,2
DA:261,4 DA:261,2
DA:264,2
DA:265,0 DA:265,0
DA:268,2 DA:268,2
DA:269,2
DA:271,2 DA:271,2
DA:272,0 DA:272,2
DA:274,2 DA:275,2
DA:276,2
DA:280,4 DA:280,4
DA:285,4 DA:283,0
DA:286,0 DA:285,0
DA:290,1 DA:292,4
DA:291,4
DA:294,4 DA:294,4
DA:295,1 DA:295,1
DA:296,1 DA:296,1
@ -650,114 +644,121 @@ DA:311,1
DA:312,1 DA:312,1
DA:317,1 DA:317,1
DA:320,2 DA:320,2
DA:321,2 DA:322,2
DA:326,2 DA:327,2
DA:337,4 DA:335,1
DA:339,4 DA:336,0
DA:342,2 DA:337,0
DA:343,2 DA:338,0
DA:344,2 DA:340,0
DA:346,2 DA:342,0
DA:347,2 DA:343,0
DA:345,0
DA:347,0
DA:348,0 DA:348,0
DA:352,2 DA:350,0
DA:353,0 DA:351,0
DA:356,2 DA:352,0
DA:358,2 DA:354,0
DA:359,0 DA:355,0
DA:362,2 DA:356,0
DA:364,2 DA:361,0
DA:366,2 DA:367,1
DA:371,4 DA:368,2
DA:374,1 DA:369,2
LF:152 DA:376,2
LH:95 DA:377,0
BRDA:18,1,0,0 DA:378,0
BRDA:18,1,1,2 DA:381,0
BRDA:25,2,0,2 DA:389,1
BRDA:25,2,1,0 LF:155
BRDA:25,3,0,2 LH:97
BRDA:25,3,1,1 BRDA:48,1,0,0
BRDA:27,4,0,0 BRDA:48,1,1,4
BRDA:27,4,1,2 BRDA:67,2,0,0
BRDA:27,5,0,2 BRDA:67,2,1,2
BRDA:27,5,1,2 BRDA:74,3,0,2
BRDA:44,6,0,0 BRDA:74,3,1,0
BRDA:44,6,1,0 BRDA:74,4,0,2
BRDA:49,7,0,0 BRDA:74,4,1,1
BRDA:49,7,1,0 BRDA:76,5,0,0
BRDA:55,8,0,0 BRDA:76,5,1,2
BRDA:55,8,1,0 BRDA:76,6,0,2
BRDA:55,9,0,0 BRDA:76,6,1,2
BRDA:55,9,1,0 BRDA:93,7,0,0
BRDA:88,10,0,0 BRDA:93,7,1,0
BRDA:88,10,1,4 BRDA:98,8,0,0
BRDA:98,11,0,3 BRDA:98,8,1,0
BRDA:98,11,1,1 BRDA:104,9,0,0
BRDA:101,12,0,2 BRDA:104,9,1,0
BRDA:101,12,1,2 BRDA:104,10,0,0
BRDA:101,13,0,4 BRDA:104,10,1,0
BRDA:101,13,1,3 BRDA:120,11,0,2
BRDA:102,14,0,2 BRDA:120,11,1,0
BRDA:102,14,1,0 BRDA:121,12,0,0
BRDA:108,15,0,0 BRDA:121,12,1,2
BRDA:108,15,1,0 BRDA:126,13,0,0
BRDA:113,16,0,0 BRDA:126,13,1,2
BRDA:113,16,1,0 BRDA:132,14,0,0
BRDA:118,17,0,0 BRDA:132,14,1,2
BRDA:118,17,1,0 BRDA:132,15,0,2
BRDA:121,18,0,0 BRDA:132,15,1,2
BRDA:121,18,1,0 BRDA:145,16,0,2
BRDA:122,19,0,0 BRDA:145,16,1,0
BRDA:122,19,1,0 BRDA:145,17,0,2
BRDA:147,20,0,0 BRDA:145,17,1,1
BRDA:147,20,1,2 BRDA:146,18,0,0
BRDA:161,21,0,1 BRDA:146,18,1,2
BRDA:161,21,1,1 BRDA:156,19,0,2
BRDA:189,22,0,2 BRDA:156,19,1,0
BRDA:189,22,1,2 BRDA:162,20,0,0
BRDA:216,23,0,2 BRDA:162,20,1,2
BRDA:216,23,1,0 BRDA:162,21,0,2
BRDA:216,24,0,2 BRDA:162,21,1,2
BRDA:216,24,1,1 BRDA:177,22,0,2
BRDA:217,25,0,0 BRDA:177,22,1,0
BRDA:217,25,1,2 BRDA:199,23,0,2
BRDA:227,26,0,2 BRDA:199,23,1,2
BRDA:227,26,1,0 BRDA:226,24,0,0
BRDA:233,27,0,0 BRDA:226,24,1,2
BRDA:233,27,1,2 BRDA:233,25,0,0
BRDA:233,28,0,2 BRDA:233,25,1,2
BRDA:233,28,1,2 BRDA:247,26,0,0
BRDA:248,29,0,2 BRDA:247,26,1,4
BRDA:248,29,1,0 BRDA:255,27,0,3
BRDA:264,30,0,0 BRDA:255,27,1,1
BRDA:264,30,1,2 BRDA:258,28,0,2
BRDA:271,31,0,0 BRDA:258,28,1,2
BRDA:271,31,1,2 BRDA:258,29,0,4
BRDA:285,32,0,0 BRDA:258,29,1,3
BRDA:285,32,1,4 BRDA:259,30,0,2
BRDA:294,33,0,1 BRDA:259,30,1,0
BRDA:294,33,1,3 BRDA:269,31,0,1
BRDA:296,34,0,0 BRDA:269,31,1,1
BRDA:296,34,1,1 BRDA:294,32,0,1
BRDA:310,35,0,1 BRDA:294,32,1,3
BRDA:296,33,0,0
BRDA:296,33,1,1
BRDA:310,34,0,1
BRDA:310,34,1,2
BRDA:310,35,0,3
BRDA:310,35,1,2 BRDA:310,35,1,2
BRDA:310,36,0,3 BRDA:311,36,0,0
BRDA:310,36,1,2 BRDA:311,36,1,1
BRDA:311,37,0,0 BRDA:320,37,0,1
BRDA:311,37,1,1 BRDA:320,37,1,1
BRDA:320,38,0,1 BRDA:337,38,0,0
BRDA:320,38,1,1 BRDA:337,38,1,0
BRDA:346,39,0,2 BRDA:342,39,0,0
BRDA:346,39,1,0 BRDA:342,39,1,0
BRDA:347,40,0,0 BRDA:347,40,0,0
BRDA:347,40,1,2 BRDA:347,40,1,0
BRDA:352,41,0,0 BRDA:350,41,0,0
BRDA:352,41,1,2 BRDA:350,41,1,0
BRDA:358,42,0,0 BRDA:351,42,0,0
BRDA:358,42,1,2 BRDA:351,42,1,0
BRDA:358,43,0,2 BRDA:376,43,0,0
BRDA:358,43,1,2 BRDA:376,43,1,2
BRF:86 BRF:86
BRH:48 BRH:48
end_of_record end_of_record

View file

@ -18,7 +18,7 @@ describe('TCP Socket verification of client',
'Verify retry attempts by TCP client to connect to the server as per the value set in "maxRetries" parameter.', 'Verify retry attempts by TCP client to connect to the server as per the value set in "maxRetries" parameter.',
function testIt(done){ function testIt(done){
ipc.config.id ='testClient'; ipc.config.id ='testClient';
ipc.config.retry = 600; ipc.config.retry = 60;
ipc.config.maxRetries = 3; ipc.config.maxRetries = 3;
ipc.config.stopRetrying = false; ipc.config.stopRetrying = false;

View file

@ -11,7 +11,7 @@ describe(
function testIt(done){ function testIt(done){
ipc.config.networkPort=8095; ipc.config.networkPort=8095;
ipc.config.id ='testClient'; ipc.config.id ='testClient';
ipc.config.retry = 600; ipc.config.retry = 60;
let clientPort=8001; let clientPort=8001;
@ -65,7 +65,7 @@ describe(
function testIt(done){ function testIt(done){
ipc.config.networkPort=8099; ipc.config.networkPort=8099;
ipc.config.id ='testClient'; ipc.config.id ='testClient';
ipc.config.retry = 600; ipc.config.retry = 60;
let clientPort=8010; let clientPort=8010;

View file

@ -4,7 +4,7 @@
const ipc = require('../../../../node-ipc'); const ipc = require('../../../../node-ipc');
ipc.config.id ='testClient'; ipc.config.id ='testClient';
ipc.config.retry = 600; ipc.config.retry = 60;
describe('Test Cases for Unix client: ', describe('Test Cases for Unix client: ',
function UnixClientSpec(){ function UnixClientSpec(){

View file

@ -2,7 +2,7 @@
const ipc=require('../../../node-ipc'); const ipc=require('../../../node-ipc');
const process=require('process'); const process=require('process');
const dieAfter=30000; const dieAfter=60000;
//die after 60 seconds //die after 60 seconds
setTimeout( setTimeout(
@ -21,10 +21,22 @@ ipc.config.networkPort=8095;
ipc.serveNet( ipc.serveNet(
'udp4', 'udp4',
function serverStarted(){ function serverStarted(){
console.log(`
UP
`);
ipc.server.on( ipc.server.on(
'message', 'message',
function gotMessage(data,socket){ function gotMessage(data,socket){
ipc.server.emit( console.log(`
MESSAGE
`);
ipc.server.emit(
socket, socket,
'message', 'message',
{ {

View file

@ -2,7 +2,7 @@
const ipc=require('../../../node-ipc'); const ipc=require('../../../node-ipc');
const process=require('process'); const process=require('process');
const dieAfter=30000; const dieAfter=60000;
//die after 60 seconds //die after 60 seconds
setTimeout( setTimeout(