How to use the ice.Ice function in ice

To help you get started, we’ve selected a few ice examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zeroc-ice / ice-demos / js / Ice / bidir / Client.js View on Github external
// **********************************************************************
//
// 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;
github zeroc-ice / ice-demos / js / Glacier2 / simpleChat / Client.js View on Github external
// **********************************************************************
//
// 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);
        }
github zeroc-ice / ice-demos / js / Ice / throughput / Client.js View on Github external
// **********************************************************************
//
// 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";
}
github zeroc-ice / ice-demos / js / Ice / hello / Client.js View on Github external
// **********************************************************************
//
// 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;
github zeroc-ice / ice-demos / js / Ice / latency / Client.js View on Github external
// **********************************************************************
//
// 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
github zeroc-ice / ice-demos / js / Manual / printer / Client.js View on Github external
// **********************************************************************
//
// 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
        {
github JdeRobot / WebSim2D / websim / js / Ice / exceptions.js View on Github external
(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);
github JdeRobot / WebSim2D / websim / js / Ice / containers.js View on Github external
(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,
github JdeRobot / WebSim2D / websim / js / Ice / common.js View on Github external
(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,
github JdeRobot / WebSim2D / websim / js / Ice / motors.js View on Github external
(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);