2014-09-05 11:50:23 +10:00
|
|
|
var ipc = require('../../../node-ipc'),
|
|
|
|
server=__dirname.split('/'),
|
|
|
|
server=server[server.length-1]
|
|
|
|
|
|
|
|
ipc.config.id = server+'-client';
|
2014-09-05 15:06:25 +10:00
|
|
|
ipc.config.maxRetries=50;
|
2014-09-05 11:50:23 +10:00
|
|
|
|
|
|
|
ipc.connectTo(
|
|
|
|
server,
|
|
|
|
function(){
|
|
|
|
ipc.of[server].on(
|
|
|
|
'connect',
|
|
|
|
function(){
|
|
|
|
ipc.of[server].emit(
|
|
|
|
'test-test',
|
|
|
|
{
|
|
|
|
id:ipc.config.id
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2014-09-05 15:06:25 +10:00
|
|
|
//wait to ensure above event has opportunity to tranfer and register client properly
|
|
|
|
setTimeout(
|
|
|
|
function(){
|
|
|
|
ipc.disconnect(server);
|
|
|
|
},
|
|
|
|
100
|
|
|
|
);
|
|
|
|
|
|
|
|
//wait long enough that the test will fail if disconnect does not happen
|
|
|
|
setTimeout(
|
|
|
|
function(){
|
|
|
|
process.exit(0);
|
|
|
|
},
|
|
|
|
2000
|
|
|
|
)
|
2014-09-05 11:50:23 +10:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|