示例#1
0
        static void Main(string[] args)
        {
            int poolSize;

            if (!(args.Length > 0 && int.TryParse(args[0], out poolSize)))
            {
                poolSize = AppHostHttpListenerBase.CalculatePoolSize();
            }

            DbProvider db;

            if (!(args.Length > 1 && Enum.TryParse(args[1], true, out db)))
            {
                db = DbProvider.InMemory;
            }

            new AppHost(poolSize, db)
            .Init()
            .Start("http://*:55003/");

            "\nSmartPool started with ThreadPool size of {0} using {1} listening on tcp port 55003"
            .Print(poolSize, db);
            "Press Enter to Quit".Print();
            Console.ReadLine();
        }
        public WinService(AppHostHttpListenerBase appHost, string listeningOn)
        {
            this.appHost     = appHost;
            this.listeningOn = listeningOn;

            this.appHost.Init();

            InitializeComponent();
        }
示例#3
0
 public void Dispose()
 {
     if (appHost == null)
     {
         return;
     }
     appHost.Dispose();
     appHost = null;
 }
 public virtual void TestFixtureSetUp()
 {
     appHost = CreateListener();
     appHost.Init();
     appHost.Start(BaseUrl);
 }
 public virtual void TestFixtureSetUp()
 {
     listener = CreateListener();
     listener.Init();
     listener.Start(BaseUrl);
 }