1 // **********************************************************************
3 // Copyright (c) 2003-2011 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.")]
22 private static int run(string[] args
, Ice
.Communicator communicator
)
24 communicator
.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010");
25 Ice
.ObjectAdapter adapter
= communicator
.createObjectAdapter("TestAdapter");
26 adapter
.add(new MyClassI(), communicator
.stringToIdentity("test"));
29 communicator
.waitForShutdown();
33 public static int Main(string[] args
)
36 Ice
.Communicator communicator
= null;
39 Debug
.Listeners
.Add(new ConsoleTraceListener());
44 Ice
.InitializationData data
= new Ice
.InitializationData();
47 // When using Ice for .NET Compact Framework, we need to specify
48 // the assembly so that Ice can locate classes and exceptions.
50 data
.properties
= Ice
.Util
.createProperties();
51 data
.properties
.setProperty("Ice.FactoryAssemblies", "server");
53 communicator
= Ice
.Util
.initialize(ref args
, data
);
54 status
= run(args
, communicator
);
56 catch(System
.Exception ex
)
58 Console
.Error
.WriteLine(ex
);
62 if(communicator
!= null)
66 communicator
.destroy();
68 catch(Ice
.LocalException ex
)
70 Console
.Error
.WriteLine(ex
);