Ejemplo n.º 1
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            communicator = Ice.Util.initialize(ref args);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 2
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.Default.Locator", "locator:default -p 12010");
            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 3
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData data = new Ice.InitializationData();
            communicator = Ice.Util.initialize(ref args, data);
            status       = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 4
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            communicator        = Ice.Util.initialize(ref args, initData);
            status = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            communicator.destroy();
        }

        return(status);
    }
Ejemplo n.º 5
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ThreadPool.Server.ThreadPriority", "AboveNormal");
            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 6
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);

            //
            // For this test, we want to disable retries.
            //
            initData.properties.setProperty("Ice.RetryIntervals", "-1");

            //
            // This test kills connections, so we don't want warnings.
            //
            initData.properties.setProperty("Ice.Warn.Connections", "0");

            initData.properties.setProperty("Ice.MessageSizeMax", "50000");

            //
            // Setup the test transport plug-in.
            //
            string defaultProtocol = initData.properties.getPropertyWithDefault("Ice.Default.Protocol", "tcp");
            initData.properties.setProperty("Ice.Default.Protocol", "test-" + defaultProtocol);

            communicator = Ice.Util.initialize(ref args, initData);
            PluginI plugin = new PluginI(communicator);
            plugin.initialize();
            communicator.getPluginManager().addPlugin("Test", plugin);

            status = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 7
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);

            //
            // We need to send messages large enough to cause the transport
            // buffers to fill up.
            //
            initData.properties.setProperty("Ice.MessageSizeMax", "20000");

            //
            // For this test, we want to disable retries.
            //
            initData.properties.setProperty("Ice.RetryIntervals", "-1");

            //
            // This test kills connections, so we don't want warnings.
            //
            initData.properties.setProperty("Ice.Warn.Connections", "0");

            //
            // Limit the send buffer size, this test relies on the socket
            // send() blocking after sending a given amount of data.
            //
            initData.properties.setProperty("Ice.TCP.SndSize", "50000");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 8
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

#if !COMPACT && !UNITY
        Debug.Listeners.Add(new ConsoleTraceListener());
#endif

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.Package.Test", "test.Ice.metrics");
            initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010");
            initData.properties.setProperty("Ice.Admin.Endpoints", "tcp");
            initData.properties.setProperty("Ice.Admin.InstanceName", "client");
            initData.properties.setProperty("Ice.Admin.DelayCreation", "1");
            initData.properties.setProperty("Ice.Warn.Connections", "0");
            initData.properties.setProperty("Ice.Warn.Dispatch", "0");
            initData.properties.setProperty("Ice.MessageSizeMax", "50000");
            initData.properties.setProperty("Ice.Default.Host", "127.0.0.1");
#if COMPACT
            //
            // When using Ice for .NET Compact Framework, we need to specify
            // the assembly so that Ice can locate classes and exceptions.
            //
            initData.properties.setProperty("Ice.FactoryAssemblies", "collocated");
#endif
            initData.observer = _observer;
            communicator      = Ice.Util.initialize(ref args, initData);
            status            = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 9
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator ic = null;
        try
        {
            Ice.InitializationData data = new Ice.InitializationData();

            //
            // Create a communicator
            //
            ic = Ice.Util.initialize(ref args, data);

            //
            // Create a proxy for the root directory
            //
            Ice.ObjectPrx obj = ic.stringToProxy("RootDir:default -h localhost -p 10000");

            //
            // Down-cast the proxy to a Directory proxy
            //
            DirectoryPrx rootDir = DirectoryPrxHelper.checkedCast(obj);
            if (rootDir == null)
            {
                throw new ApplicationException("Invalid proxy");
            }

            //
            // Recursively list the contents of the root directory
            //
            Console.WriteLine("Contents of root directory:");
            listRecursive(rootDir, 0);
        }
        catch (Exception e)
        {
            Console.Error.WriteLine(e);
            status = 1;
        }
        if (ic != null)
        {
            try
            {
                ic.destroy();
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e);
                status = 1;
            }
        }
        return(status);
    }
Ejemplo n.º 10
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            //
            // In this test, we need at least two threads in the
            // client side thread pool for nested AMI.
            //
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2");
            initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");

            //
            // We must set MessageSizeMax to an explicit values,
            // because we run tests to check whether
            // Ice.MemoryLimitException is raised as expected.
            //
            initData.properties.setProperty("Ice.MessageSizeMax", "100");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 11
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.Warn.AMICallback", "0");
#if COMPACT
            //
            // When using Ice for .NET Compact Framework, we need to specify
            // the assembly so that Ice can locate classes and exceptions.
            //
            initData.properties.setProperty("Ice.FactoryAssemblies", "client");
#endif
            //
            // Limit the send buffer size, this test relies on the socket
            // send() blocking after sending a given amount of data.
            //
            initData.properties.setProperty("Ice.TCP.SndSize", "50000");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 12
0
 public static int Main(string[] args)
 {
     try
     {
         Ice.Communicator communicator = Ice.Util.initialize(ref args);
         HelloPrx         hello        = HelloPrxHelper.checkedCast(communicator.stringToProxy("hello:tcp -p 10000"));
         hello.sayHello();
         communicator.destroy();
         return(0);
     }
     catch (System.Exception ex)
     {
         System.Console.Error.WriteLine(ex);
         return(1);
     }
 }
Ejemplo n.º 13
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ServerIdleTime", "30");

            //
            // Disable collocation optimization to test async/await dispatch.
            //
            initData.properties.setProperty("Ice.Default.CollocationOptimized", "0");

            //
            // Limit the recv buffer size, this test relies on the socket
            // send() blocking after sending a given amount of data.
            //
            initData.properties.setProperty("Ice.TCP.RcvSize", "50000");
            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 14
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);

            //
            // This test kills connections, so we don't want warnings.
            //
            initData.properties.setProperty("Ice.Warn.Connections", "0");

            //
            // Limit the recv buffer size, this test relies on the socket
            // send() blocking after sending a given amount of data.
            //
            initData.properties.setProperty("Ice.TCP.RcvSize", "50000");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 15
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

#if !COMPACT && !UNITY
        Debug.Listeners.Add(new ConsoleTraceListener());
#endif

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.Package.Test", "test.Ice.retry");
            initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010");
            initData.properties.setProperty("Ice.Admin.Endpoints", "tcp");
            initData.properties.setProperty("Ice.Admin.InstanceName", "server");
            initData.properties.setProperty("Ice.Warn.Connections", "0");
            initData.properties.setProperty("Ice.Warn.Dispatch", "0");
            initData.properties.setProperty("Ice.MessageSizeMax", "50000");
            initData.properties.setProperty("Ice.Default.Host", "127.0.0.1");
            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 16
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);

            //
            // For this test, we want to disable retries.
            //
            initData.properties.setProperty("Ice.RetryIntervals", "-1");

            //
            // This test kills connections, so we don't want warnings.
            //
            initData.properties.setProperty("Ice.Warn.Connections", "0");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 17
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties();
#if COMPACT
            //
            // When using Ice for .NET Compact Framework, we need to specify
            // the assembly so that Ice can locate classes and exceptions.
            //
            initData.properties.setProperty("Ice.FactoryAssemblies", "client");
#endif
            // We don't need to disable warnings because we have a dummy logger.
            //initData.properties.setProperty("Ice.Warn.Dispatch", "0");
            initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
            initData.properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max
            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 18
0
    public static int Main(String[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2"); // For nested AMI.
            initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
            initData.properties.setProperty("Ice.BatchAutoFlushSize", "100");

            //
            // Its possible to have batch oneway requests dispatched
            // after the adapter is deactivated due to thread
            // scheduling so we supress this warning.
            //
            initData.properties.setProperty("Ice.Warn.Dispatch", "0");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 19
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;
        Debug.Listeners.Add(new ConsoleTraceListener());
        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.Package.Test", "test.Ice.metrics");
            initData.properties.setProperty("Ice.Admin.Endpoints", "tcp");
            initData.properties.setProperty("Ice.Admin.InstanceName", "client");
            initData.properties.setProperty("Ice.Admin.DelayCreation", "1");
            initData.properties.setProperty("Ice.Warn.Connections", "0");
            initData.properties.setProperty("Ice.MessageSizeMax", "50000");
            initData.properties.setProperty("Ice.Default.Host", "127.0.0.1");

            initData.observer = _observer;
            communicator      = Ice.Util.initialize(ref args, initData);
            status            = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 20
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.Warn.AMICallback", "0");
            //
            // Limit the send buffer size, this test relies on the socket
            // send() blocking after sending a given amount of data.
            //
            initData.properties.setProperty("Ice.TCP.SndSize", "50000");
            initData.dispatcher = new Dispatcher().dispatch;
            communicator        = Ice.Util.initialize(ref args, initData);
            status = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        Dispatcher.terminate();

        return(status);
    }
Ejemplo n.º 21
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.Warn.Dispatch", "0");
            initData.properties.setProperty("Ice.Warn.Connections", "0");
            initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
            initData.properties.setProperty("Ice.MessageSizeMax", "10"); // 10KB max
            initData.properties.setProperty("TestAdapter2.Endpoints", "default -p 12011");
            initData.properties.setProperty("TestAdapter2.MessageSizeMax", "0");
            initData.properties.setProperty("TestAdapter3.Endpoints", "default -p 12012");
            initData.properties.setProperty("TestAdapter3.MessageSizeMax", "1");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 22
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            //
            // In this test, we need at least two threads in the
            // client side thread pool for nested AMI.
            //
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2");
            initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
            initData.properties.setProperty("Ice.BatchAutoFlushSize", "100");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 23
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData data = new Ice.InitializationData();
#if COMPACT
            //
            // When using Ice for .NET Compact Framework, we need to specify
            // the assembly so that Ice can locate classes and exceptions.
            //
            data.properties = Ice.Util.createProperties();
            data.properties.setProperty("Ice.FactoryAssemblies", "collocated");
#endif

            communicator = Ice.Util.initialize(ref args, data);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 24
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            //
            // In this test, we need longer server idle time,
            // otherwise our test servers may time out before they are
            // used in the test.
            //
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ServerIdleTime", "120"); // Two minutes

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 25
0
 public override void run(Ice.Communicator communicator)
 {
     //
     // Configure a second communicator for the invocation timeout
     // + retry test, we need to configure a large retry interval
     // to avoid time-sensitive failures.
     //
     Ice.InitializationData initData2 = new Ice.InitializationData();
     initData2.properties = communicator.getProperties().ice_clone_();
     initData2.properties.setProperty("Ice.RetryIntervals", "0 1 10000");
     initData2.observer = Instrumentation.getObserver();
     Ice.Communicator communicator2 = Ice.Util.initialize(initData2);
     try
     {
         allTests(communicator, communicator2, "retry:default -p 12010");
     }
     finally
     {
         communicator2.destroy();
     }
 }
Ejemplo n.º 26
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

#if !COMPACT && !UNITY
        Debug.Listeners.Add(new ConsoleTraceListener());
#endif

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ServerIdleTime", "30");
            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 27
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            //
            // This test aborts servers, so we don't want warnings.
            //
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.Warn.Connections", "0");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 28
0
    public static int Main(String[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ThreadPool.Client.Size", "2"); // For nested AMI.
            initData.properties.setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
            initData.properties.setProperty("Ice.Warn.Dispatch", "0");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 29
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);

            initData.properties.setProperty("Ice.Warn.Connections", "0");
            initData.properties.setProperty("Ice.UDP.RcvSize", "16384");

            communicator = Ice.Util.initialize(ref args, initData);
            status       = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        return(status);
    }
Ejemplo n.º 30
0
    public static int Main(string[] args)
    {
        int status = 0;

        Ice.Communicator communicator = null;

        try
        {
            Ice.InitializationData initData = new Ice.InitializationData();
            initData.properties = Ice.Util.createProperties(ref args);
            initData.properties.setProperty("Ice.ServerIdleTime", "30");
            initData.dispatcher = new Dispatcher().dispatch;
            communicator        = Ice.Util.initialize(ref args, initData);
            status = run(args, communicator);
        }
        catch (System.Exception ex)
        {
            System.Console.Error.WriteLine(ex);
            status = 1;
        }

        if (communicator != null)
        {
            try
            {
                communicator.destroy();
            }
            catch (Ice.LocalException ex)
            {
                System.Console.Error.WriteLine(ex);
                status = 1;
            }
        }

        Dispatcher.terminate();

        return(status);
    }