1
// **********************************************************************
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
5
// This copy of Ice is licensed to you under the terms described in the
6
// ICE_LICENSE file included in this distribution.
8
// **********************************************************************
11
using System.Diagnostics;
12
using System.Reflection;
14
[assembly: CLSCompliant(true)]
16
[assembly: AssemblyTitle("IceTest")]
17
[assembly: AssemblyDescription("Ice test")]
18
[assembly: AssemblyCompany("ZeroC, Inc.")]
20
public class ServantLocatorI : Ice.ServantLocator
22
public ServantLocatorI(bool async)
26
_blobject = new BlobjectAsyncI();
30
_blobject = new BlobjectI();
35
locate(Ice.Current current, out System.Object cookie)
42
finished(Ice.Current current, Ice.Object servant, System.Object cookie)
47
deactivate(string category)
51
private Ice.Object _blobject;
56
public static int run(string[] args, Ice.Communicator communicator)
59
for(int i = 0; i < args.Length; ++i)
61
if(args[i].Equals("--async"))
67
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
68
Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
69
adapter.addServantLocator(new ServantLocatorI(async), "");
72
communicator.waitForShutdown();
76
public static void Main(string[] args)
79
Ice.Communicator communicator = null;
81
Debug.Listeners.Add(new ConsoleTraceListener());
85
Ice.InitializationData initData = new Ice.InitializationData();
86
initData.properties = Ice.Util.createProperties(ref args);
87
communicator = Ice.Util.initialize(ref args, initData);
88
status = run(args, communicator);
90
catch(System.Exception ex)
92
Console.Error.WriteLine(ex);
96
if(communicator != null)
100
communicator.destroy();
102
catch(Ice.LocalException ex)
104
Console.Error.WriteLine(ex);
111
System.Environment.Exit(status);