node-ipc/testHarness/tests/unix-socket-test/client.js

39 lines
1 KiB
JavaScript
Raw Normal View History

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';
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
}
);
//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
}
);
}
);