當前位置: 首頁>>代碼示例>>C#>>正文


C# AppHost.Start方法代碼示例

本文整理匯總了C#中AppHost.Start方法的典型用法代碼示例。如果您正苦於以下問題:C# AppHost.Start方法的具體用法?C# AppHost.Start怎麽用?C# AppHost.Start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AppHost的用法示例。


在下文中一共展示了AppHost.Start方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestFixtureSetUp

 public void TestFixtureSetUp()
 {
     LogManager.LogFactory = new ConsoleLogFactory();
     appHost = new AppHost();
     appHost.Init();
     appHost.Start("http://*:1337/");
 }
開發者ID:ServiceStack,項目名稱:ServiceStack,代碼行數:7,代碼來源:Benchmarks.cs

示例2: Main

        public static void Main(string[] args)
        {
            Console.WriteLine ("Starting monotest service");

            // configure JSON serializer
            JsConfig.EmitCamelCaseNames = true;

            var exit = false;
            var signals = new[] {
                new UnixSignal(Signum.SIGINT),
                new UnixSignal(Signum.SIGTERM)
            };

            var host = new AppHost();

            host.Init();
            host.Start("http://+:8080/");

            // wait for termination
            while (!exit)
            {
                var id = UnixSignal.WaitAny(signals);

                if (id >= 0 && id < signals.Length)
                {
                    if (signals[id].IsSet)
                        exit = true;
                }
            }

            Console.WriteLine("Terminating monotest service");
        }
開發者ID:kongo2002,項目名稱:docker-centos-servicestack,代碼行數:32,代碼來源:Program.cs

示例3: Init

        public void Init()
        {
            var configure = Configure.With()
            .DefaultBuilder()
                .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith("Commands"))
                .DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith("Events"))
            .RunTimeoutManager()
            .Log4Net()
            .XmlSerializer()
            .MsmqTransport()
                .IsTransactional(true)
                .PurgeOnStartup(false)
            .RavenPersistence()
            .Sagas()
                .RavenSagaPersister()
            .UnicastBus()
                .ImpersonateSender(false)
                .LoadMessageHandlers();

            const string listeningOn = "http://*:8888/";
            var appHost = new AppHost();
            appHost.Init();
            appHost.Start(listeningOn);

            Configure.Instance.Configurer.ConfigureComponent<RavenDocStore>(DependencyLifecycle.SingleInstance);
            Configure.Instance.Configurer.ConfigureComponent<TimeoutCalculator>(DependencyLifecycle.InstancePerUnitOfWork);
            Configure.Instance.Configurer.ConfigureComponent<SmsService>(DependencyLifecycle.InstancePerUnitOfWork);
            Configure.Instance.Configurer.ConfigureComponent<SmsTechWrapper>(DependencyLifecycle.InstancePerUnitOfWork);

            var bus = configure.CreateBus().Start();            //.Start(() => Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install());

            appHost.Container.Register(bus);
            appHost.Container.RegisterAutoWiredAs<RavenDocStore, IRavenDocStore>();//.RegisterAs<IRavenDocStore>(new RavenDocStore());
        }
開發者ID:Compassion,項目名稱:SmsScheduler,代碼行數:34,代碼來源:EndpointConfig.cs

示例4: Run

        public override int Run(string[] remainingArguments)
        {
            var packageRepositories = new List<IPackageRepository>();

            if (!string.IsNullOrEmpty(Json))
                packageRepositories.Add(new JsonFilePackageRepository(Json));

            if (!string.IsNullOrEmpty(Xml))
                packageRepositories.Add(new XmlFilePackageRepository(Xml));

            if (!string.IsNullOrEmpty(StashBaseUri) && !string.IsNullOrEmpty(StashProjectKey))
                packageRepositories.Add(new StashPackageRepository(StashBaseUri, StashProjectKey, StashUsername, StashPassword, StashSshInsteadOfHttp));

            if (packageRepositories.Count == 0)
                packageRepositories.Add(new InMemoryPackageRepository());

            var listener = string.Format("http://*:{0}/", Port);

            var appHost = new AppHost();
            appHost.Init();
            appHost.Container.Register<IPackageRepository>(_ => new AggregatePackageRepository(packageRepositories));

            System.Console.WriteLine("Listening on {0}", listener);
            appHost.Start(listener);

            Thread.Sleep(Timeout.Infinite);

            return 0;
        }
開發者ID:rolandzwaga,項目名稱:Bower-Registry,代碼行數:29,代碼來源:ServerCommand.cs

示例5: JournalServiceTests

 public JournalServiceTests()
 {
     stopWatch = Stopwatch.StartNew();
     appHost = new AppHost();
     appHost.Init();
     appHost.Start("http://*:8888/");
 }
開發者ID:KyleGobel,項目名稱:Systematize,代碼行數:7,代碼來源:JournalServiceTests.cs

示例6: TestFixtureSetUp

	    public void TestFixtureSetUp()
	    {
            startedAt = Stopwatch.StartNew();
            appHost = new AppHost();
	        appHost.Init();
            appHost.Start("http://*:1337/");
	    }
開發者ID:BilliamBrown,項目名稱:ServiceStack,代碼行數:7,代碼來源:RazorRockstars_EmbeddedFilesTests.cs

示例7: Main

 public static void Main()
 {
     // Very simple console host
     var appHost = new AppHost(500);
     appHost.Init();
     appHost.Start("http://*:9000/");
     Console.ReadKey();
 }
開發者ID:scottmcarthur,項目名稱:ServiceStackAdvancedPermissions,代碼行數:8,代碼來源:Program.cs

示例8: AppHost

 public static void Запустить()
 {
     const string listeningOn = "https://*:1337/";
     var appHost = new AppHost();
     appHost.Init();
     appHost.Start(listeningOn);
     Console.WriteLine("AppHost Created at {0}, listening on {1}", DateTime.Now, listeningOn);
 }
開發者ID:Rugut,項目名稱:UPP,代碼行數:8,代碼來源:WebHost.cs

示例9: Main

        static void Main(string[] args)
        {
            var appHost = new AppHost();
            appHost.Init();
            appHost.Start("http://localhost:2211/");

            Console.Read();
        }
開發者ID:gregsochanik,項目名稱:basic-servicestack-catalogue,代碼行數:8,代碼來源:Program.cs

示例10: TestFixtureSetUp

 public void TestFixtureSetUp()
 {
     LogManager.LogFactory = new ConsoleLogFactory();
     startedAt = Stopwatch.StartNew();
     appHost = new AppHost();
     appHost.Init();
     appHost.Start(ListeningOn);
 }
開發者ID:remkoboschker,項目名稱:ServiceStack,代碼行數:8,代碼來源:RazorRockstars_FilesTests.cs

示例11: Main

        public static void Main(string[] args)
        {
            var appHost = new AppHost();
            appHost.Init();
            appHost.Start("http://localhost:1337/");

            var client = new JsonServiceClient("http://localhost:1337");
            client.Head(new SampleHeadRequest { EMail = "[email protected]" });
        }
開發者ID:KyleGobel,項目名稱:ServiceStackHead,代碼行數:9,代碼來源:Program.cs

示例12: Main

 private static void Main(string[] args)
 {
     var appHost = new AppHost();
     appHost.Init();
     appHost.Start("http://*:1337/");
     System.Console.WriteLine("Listening on http://localhost:1337/ ...");
     System.Console.ReadLine();
     System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
 }
開發者ID:roconnell1,項目名稱:SSV3,代碼行數:9,代碼來源:AppHost.cs

示例13: OnTestFixtureSetUp

        public void OnTestFixtureSetUp()
        {
            LogManager.LogFactory = new ConsoleLogFactory();

            appHost = new AppHost { EnableRazor = false };
            appHost.Plugins.Add(new MsgPackFormat());
            appHost.Init();
            appHost.Start(ListeningOn);
        }
開發者ID:CLupica,項目名稱:ServiceStack,代碼行數:9,代碼來源:MsgPackServiceTests.cs

示例14: OnStart

        /// <summary>
        /// Called when the service starts.
        /// </summary>
        /// <param name="args"></param>
        protected override void OnStart(string[] args)
        {
            // get the hostname.
            string hostname = ConfigurationManager.AppSettings["hostname"];

            // start the self-hosting.
            _host = new AppHost();
            _host.Init();
            _host.Start(hostname);

        }
開發者ID:nagyistoce,項目名稱:OsmSharp.Service.Data,代碼行數:15,代碼來源:Service.cs

示例15: Run_for_10Mins

        public void Run_for_10Mins()
        {
            using (var appHost = new AppHost())
            {
                appHost.Init();
                appHost.Start("http://localhost:11001/");

                Process.Start("http://localhost:11001/");

                Thread.Sleep(TimeSpan.FromMinutes(10));
            }
        }
開發者ID:Qasemt,項目名稱:NServiceKit,代碼行數:12,代碼來源:Startup.cs


注:本文中的AppHost.Start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。