Exemplo n.º 1
0
        public RESTServer(Config config, object tag = null)
        {
            this.IsListening = false;
            this.DirIndex = config.DirIndex;

            this.Host = config.Host;
            this.Port = config.Port;
            this.Protocol = config.Protocol;
            this.MaxThreads = config.MaxThreads;
            this.AutoLoadRestResources = config.AutoLoadRestResources;
            this.Tag = tag;
            this.ServerHeader = config.ServerHeader;

            this.WebRoot = config.WebRoot;
            if (object.ReferenceEquals(this.WebRoot, null))
            {
                this.WebRoot = Path.Combine(Path.GetDirectoryName(Assembly.GetCallingAssembly().Location), "webroot");
            }

            this._routeCache = new RouteCache(this, this.BaseUrl, this.AutoLoadRestResources);
            this._workers = new Thread[this.MaxThreads];
            this._listener.OnContext += new Action<HttpListenerContext>(QueueRequest);
        }
Exemplo n.º 2
0
 public RESTServer(Config config) : this(host: config.Host, port: config.Port, protocol: config.Protocol, dirindex: config.DirIndex, webroot: config.WebRoot, maxthreads: config.MaxThreads) { }
Exemplo n.º 3
0
 public GameStateServer(Config config)
     : base(config)
 {
 }