Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// **********************************************************************
//
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
//
// **********************************************************************
const Ice = require("ice").Ice;
const Demo = require("./generated/Callback").Demo;
//
// Define a servant class that implements Demo.CallbackReceiver
// interface.
//
class CallbackReceiverI extends Demo.CallbackReceiver
{
callback(num, current)
{
console.log("received callback #" + num);
}
}
let communicator;
// **********************************************************************
//
// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved.
//
// **********************************************************************
const Ice = require("ice").Ice;
const Glacier2 = require("ice").Glacier2;
const Demo = require("./generated/Chat").Demo;
(async function()
{
//
// Servant that implements the ChatCallback interface,
// the message operation just writes the received data
// to stdout.
//
class ChatCallbackI extends Demo.ChatCallback
{
message(data)
{
console.log(data);
}
// **********************************************************************
//
// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved.
//
// **********************************************************************
const Ice = require("ice").Ice;
const Demo = require("./generated/Throughput").Demo;
//
// Initialize sequences.
//
const byteSeq = new Buffer(Demo.ByteSeqSize);
for(let i = 0; i < Demo.ByteSeqSize; ++i)
{
byteSeq[i] = 0;
}
const stringSeq = [];
for(let i = 0; i < Demo.StringSeqSize; ++i)
{
stringSeq[i] = "hello";
}
// **********************************************************************
//
// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved.
//
// **********************************************************************
const Ice = require("ice").Ice;
const Demo = require("./generated/Hello").Demo;
(async function()
{
let communicator;
try
{
communicator = Ice.initialize(process.argv);
if(process.argv.length > 2)
{
throw new Error("too many arguments");
}
let proxy = communicator.stringToProxy("hello:default -p 10000").ice_twoway().ice_secure(false);
let timeout = -1;
// **********************************************************************
//
// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved.
//
// **********************************************************************
const Ice = require("ice").Ice;
const Demo = require("./generated/Latency").Demo;
(async function()
{
let communicator;
try
{
communicator = Ice.initialize(process.argv);
if(process.argv.length > 2)
{
throw new Error("too many arguments");
}
const repetitions = 1000;
//
// Create a proxy to the ping object and down-cast the proxy to the
// Demo.Ping interface
// **********************************************************************
//
// Copyright (c) 2003-present ZeroC, Inc. All rights reserved.
//
// **********************************************************************
const Ice = require("ice").Ice;
const Demo = require("./generated/Printer").Demo;
(async () =>
{
let communicator;
try
{
communicator = Ice.initialize();
const base = communicator.stringToProxy("SimplePrinter:default -p 10000");
const printer = await Demo.PrinterPrx.checkedCast(base);
if(printer)
{
await printer.printString("Hello World!");
}
else
{
(function(module, require, exports)
{
var Ice = require("ice").Ice;
var __M = Ice.__M;
var Slice = Ice.Slice;
var jderobot = __M.module("jderobot");
jderobot.JderobotException = Slice.defineUserException(
function(what, _cause)
{
Ice.UserException.call(this, _cause);
this.what = what !== undefined ? what : "";
},
Ice.UserException,
"jderobot::JderobotException",
function(__os)
{
__os.writeString(this.what);
(function(module, require, exports)
{
var Ice = require("ice").Ice;
var __M = Ice.__M;
var Slice = Ice.Slice;
var jderobot = __M.module("jderobot");
Slice.defineSequence(jderobot, "ByteSeqHelper", "Ice.ByteHelper", true);
Slice.defineSequence(jderobot, "IntSeqHelper", "Ice.IntHelper", true);
Slice.defineSequence(jderobot, "seqFloatHelper", "Ice.FloatHelper", true);
exports.jderobot = jderobot;
}
(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
(function(module, require, exports)
{
var Ice = require("ice").Ice;
var __M = Ice.__M;
var jderobot = __M.require(module,
[
"jderobot/datetime",
"jderobot/exceptions",
"jderobot/containers"
]).jderobot;
var Slice = Ice.Slice;
exports.jderobot = jderobot;
}
(typeof(global) !== "undefined" && typeof(global.process) !== "undefined" ? module : undefined,
(function(module, require, exports)
{
var Ice = require("ice").Ice;
var __M = Ice.__M;
var Slice = Ice.Slice;
var jderobot = __M.module("jderobot");
/**
* Interface to the Gazebo Motors Actuators interaction.
**/
jderobot.Motors = Slice.defineObject(
undefined,
Ice.Object, undefined, 1,
[
"::Ice::Object",
"::jderobot::Motors"
],
-1, undefined, undefined, false);