diff options
Diffstat (limited to 'cs/demo/Ice/throughput/Server.cs')
-rwxr-xr-x | cs/demo/Ice/throughput/Server.cs | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/cs/demo/Ice/throughput/Server.cs b/cs/demo/Ice/throughput/Server.cs index 83d6e723ee1..6d3c2558bba 100755 --- a/cs/demo/Ice/throughput/Server.cs +++ b/cs/demo/Ice/throughput/Server.cs @@ -7,49 +7,22 @@ // // ********************************************************************** -public class Server +public class Server : Ice.Application { - private static int run(string[] args, Ice.Communicator communicator) + public override int + run(string[] args) { - Ice.ObjectAdapter adapter = communicator.createObjectAdapter("Throughput"); - Ice.Object obj = new ThroughputI(); - adapter.add(obj, Ice.Util.stringToIdentity("throughput")); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Throughput"); + adapter.add(new ThroughputI(), Ice.Util.stringToIdentity("throughput")); adapter.activate(); - communicator.waitForShutdown(); + communicator().waitForShutdown(); return 0; } - + public static void Main(string[] args) { - int status = 0; - Ice.Communicator communicator = null; - - try - { - Ice.Properties properties = Ice.Util.createProperties(); - properties.load("config"); - communicator = Ice.Util.initializeWithProperties(ref args, properties); - status = run(args, communicator); - } - catch(System.Exception ex) - { - System.Console.Error.WriteLine(ex); - status = 1; - } - - if(communicator != null) - { - try - { - communicator.destroy(); - } - catch(System.Exception ex) - { - System.Console.Error.WriteLine(ex); - status = 1; - } - } - + Server app = new Server(); + int status = app.main(args, "config"); System.Environment.Exit(status); } } |