diff options
Diffstat (limited to 'cs/demo/Ice/session/Server.cs')
-rw-r--r-- | cs/demo/Ice/session/Server.cs | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/cs/demo/Ice/session/Server.cs b/cs/demo/Ice/session/Server.cs index 6c0f9c5a922..00c16e9af6f 100644 --- a/cs/demo/Ice/session/Server.cs +++ b/cs/demo/Ice/session/Server.cs @@ -7,39 +7,49 @@ // // ********************************************************************** +using Demo; using System; using System.Threading; -using Demo; +using System.Reflection; + +[assembly: CLSCompliant(true)] -public class Server : Ice.Application +[assembly: AssemblyTitle("IceSessionServer")] +[assembly: AssemblyDescription("Ice session demo server")] +[assembly: AssemblyCompany("ZeroC, Inc.")] + +public class Server { - public override int run(string[] args) + public class App : Ice.Application { - if(args.Length > 0) + public override int run(string[] args) { - Console.Error.WriteLine(appName() + ": too many arguments"); - return 1; - } + if(args.Length > 0) + { + Console.Error.WriteLine(appName() + ": too many arguments"); + return 1; + } - Ice.ObjectAdapter adapter = communicator().createObjectAdapter("SessionFactory"); + Ice.ObjectAdapter adapter = communicator().createObjectAdapter("SessionFactory"); - ReapThread reaper = new ReapThread(); - Thread reaperThread = new Thread(new ThreadStart(reaper.run)); - reaperThread.Start(); + ReapThread reaper = new ReapThread(); + Thread reaperThread = new Thread(new ThreadStart(reaper.run)); + reaperThread.Start(); - adapter.add(new SessionFactoryI(reaper), communicator().stringToIdentity("SessionFactory")); - adapter.activate(); - communicator().waitForShutdown(); + adapter.add(new SessionFactoryI(reaper), communicator().stringToIdentity("SessionFactory")); + adapter.activate(); + communicator().waitForShutdown(); - reaper.terminate(); - reaperThread.Join(); + reaper.terminate(); + reaperThread.Join(); - return 0; + return 0; + } } public static void Main(string[] args) { - Server app = new Server(); + App app = new App(); int status = app.main(args, "config.server"); if(status != 0) { |