/// <summary> /// Create applications /// /// Publish specific instance via remoting. /// http://www.dotnetremoting.cc/FAQs/PUBLISHING_OBJECT.asp /// </summary> public ApplicationServer(int AdminPort, string ApplicationBaseDir, LogStringEvent logstringevent) : base() { EnterMethod(); try { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler); if (logstringevent != null) { OnLog += logstringevent; } Applications = new ApplicationCollection(); LogString("{0}: {1}", GetType().Assembly.GetName().Name, GetType().Assembly.GetName().Version.ToString()); LogString("Publishing server objects on port {0}", AdminPort); AdminChannel = new TcpChannel(AdminPort); ChannelServices.RegisterChannel(AdminChannel); _ServerEnvironment = new ServerEnvironment(); string path = @"users" + Path.DirectorySeparatorChar.ToString(); byte[] Key = new byte[8] { 5, 100, 5, 2, 4, 24, 34, 55 }; byte[] IV = new byte[8] { 5, 100, 5, 2, 4, 24, 34, 55 }; SecurityManager = new SecurityManager(new EncryptedFileStorage(path, Key, IV)); RemotingServices.Marshal(this, "Mono.AppServer.ApplicationServer"); AvailableApplicationTypes = (ApplicationType[])ConfigurationSettings.GetConfig("Mono.AppServer"); DirectoryInfo curdir = new DirectoryInfo(ApplicationBaseDir); this.ApplicationsBaseDir = curdir.FullName + Path.DirectorySeparatorChar; LogString("\nHosting applications in {0}", Path.GetFullPath(ApplicationBaseDir)); foreach (DirectoryInfo dir in curdir.GetDirectories()) { try { LoadApplication(dir); } catch (Exception e) { SendError(e); LogString("ERROR: " + e.Message); } } } catch (Exception E) { SendError(E); throw; } finally { ExitMethod(); } }
/// <summary> /// Create applications /// /// Publish specific instance via remoting. /// http://www.dotnetremoting.cc/FAQs/PUBLISHING_OBJECT.asp /// </summary> public ApplicationServer(int AdminPort, string ApplicationBaseDir, LogStringEvent logstringevent):base() { EnterMethod(); try { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ExceptionHandler); if (logstringevent != null) { OnLog += logstringevent; } Applications=new ApplicationCollection(); LogString("{0}: {1}", GetType().Assembly.GetName().Name, GetType().Assembly.GetName().Version.ToString()); LogString("Publishing server objects on port {0}",AdminPort); AdminChannel = new TcpChannel( AdminPort ); ChannelServices.RegisterChannel( AdminChannel ); _ServerEnvironment=new ServerEnvironment(); string path=@"users"+Path.DirectorySeparatorChar.ToString (); byte[] Key=new byte[8] { 5,100,5,2,4,24,34,55 }; byte[] IV=new byte[8] { 5,100,5,2,4,24,34,55}; SecurityManager=new SecurityManager(new EncryptedFileStorage(path,Key,IV)); RemotingServices.Marshal(this,"Mono.AppServer.ApplicationServer"); AvailableApplicationTypes=(ApplicationType[]) ConfigurationSettings.GetConfig("Mono.AppServer"); DirectoryInfo curdir=new DirectoryInfo(ApplicationBaseDir); this.ApplicationsBaseDir=curdir.FullName+Path.DirectorySeparatorChar; LogString("\nHosting applications in {0}",Path.GetFullPath(ApplicationBaseDir)); foreach (DirectoryInfo dir in curdir.GetDirectories()) { try { LoadApplication(dir); } catch (Exception e) { SendError(e); LogString("ERROR: " + e.Message); } } } catch(Exception E) { SendError(E); throw; } finally { ExitMethod(); } }