public static string StartServer(int port, string[] args) { TcpServerChannel channel = new TcpServerChannel(port); ChannelServices.RegisterChannel(channel); string uri = channel.GetChannelUri() + "/DebuggerService"; DebuggerService debuggerService = new DebuggerService(args); RemotingServices.Marshal(debuggerService, "DebuggerService"); Console.WriteLine("Listening at " + uri); return uri; }
protected void Application_Start() { DynaTraceADKFactory.initialize(); //init log4net string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4netConfig.xml"); XmlConfigurator.Configure(new FileInfo(path)); log.Info("application start payment backend"); //init propertyFile ConfigUtil.InitPropertyFile(); AreaRegistration.RegisterAllAreas(); RegisterRoutes(RouteTable.Routes); if ("1".Equals(ConfigUtil.GetString("useSQLCE"))) { InitDBStuff(); } int reportSeconds = ConfigUtil.GetInt("ReportPeriodSeconds", 0); if (reportSeconds > 0) { dotNetPaymentBackend.App.Report.PaymentReport.StartBookingReport(TimeSpan.FromSeconds(reportSeconds), false); } int dbCleanUpSeconds = ConfigUtil.GetInt("dbCleanUpPeriodSeconds", 0); if (dbCleanUpSeconds > 0) { dotNetPaymentBackend.App.DBCleanUp.StartDBCleanUp(TimeSpan.FromSeconds(dbCleanUpSeconds), false); } //load plugins PluginLoader.LoadAvailablePlugins(); //Starting Remoting Server try { remotingChannel = new TcpServerChannel(ConfigUtil.GetInt("remotingPort")); ChannelServices.RegisterChannel(remotingChannel, false); RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteTime), "remoteTime", WellKnownObjectMode.Singleton); log.Info("Remoting listenening on " + remotingChannel.GetChannelUri()); } catch (Exception e) { log.Warn("Exception initializing remoting", e); } }