diff options
Diffstat (limited to 'csharp/test/Ice/seqMapping/ServerAMD.cs')
-rw-r--r-- | csharp/test/Ice/seqMapping/ServerAMD.cs | 52 |
1 files changed, 8 insertions, 44 deletions
diff --git a/csharp/test/Ice/seqMapping/ServerAMD.cs b/csharp/test/Ice/seqMapping/ServerAMD.cs index 2ad2e92d9a2..0554a5a4967 100644 --- a/csharp/test/Ice/seqMapping/ServerAMD.cs +++ b/csharp/test/Ice/seqMapping/ServerAMD.cs @@ -8,7 +8,6 @@ // ********************************************************************** using System; -using System.Diagnostics; using System.Reflection; [assembly: CLSCompliant(true)] @@ -17,57 +16,22 @@ using System.Reflection; [assembly: AssemblyDescription("Ice test")] [assembly: AssemblyCompany("ZeroC, Inc.")] -public class Server +public class Server : TestCommon.Application { - private static int run(string[] args, Ice.Communicator communicator) + public override int run(string[] args) { - communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010"); - Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter"); - adapter.add(new MyClassI(), communicator.stringToIdentity("test")); + communicator().getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint(0)); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("TestAdapter"); + adapter.add(new MyClassI(), Ice.Util.stringToIdentity("test")); adapter.activate(); - communicator.waitForShutdown(); + communicator().waitForShutdown(); return 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", "serveramd"); -#endif - communicator = Ice.Util.initialize(ref args, data); - 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; + Server app = new Server(); + return app.runmain(args); } } |