Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
let communicator;
//
// Exit on SIGINT or SIGBREAK
//
process.on(process.platform == "win32" ? "SIGBREAK" : "SIGINT", () =>
{
if(communicator)
{
communicator.destroy().finally(() => process.exit(0));
}
});
Ice.Promise.try(() =>
{
communicator = Ice.initialize(process.argv);
if(process.argv.length > 2)
{
throw("too many arguments");
}
//
// Initialize the communicator and create a proxy to the sender object.
//
const proxy = communicator.stringToProxy("sender:tcp -p 10000");
//
// Down-cast the proxy to the Demo.CallbackSender interface.
//
return Demo.CallbackSenderPrx.checkedCast(proxy).then(server =>
{
).catch(ex =>
{
console.log(ex.toString());
Ice.Promise.try(() =>
{
if(communicator)
{
return communicator.destroy();
}
}
).finally(() => process.exit(1));
});