示例#1
0
        public Gateway()
        {
            HttpServer        = new HttpApiServer();
            Routes            = new Routes.RouteCenter(this);
            Agents            = new Servers.ServerCenter(this);
            this.PluginCenter = new PluginCenter(this);
            this.Pluginer     = new Pluginer(this, null);
            //HttpServer.Options.IOQueueEnabled = true;

            Statistics.Server     = "Gateway";
            AgentMaxSocketError   = 3;
            MaxStatsUrls          = 2000;
            AgentMaxConnection    = 200;
            AgentRequestQueueSize = 2000;
            ThreadQueues          = (Environment.ProcessorCount / 2);
            if (ThreadQueues == 0)
            {
                ThreadQueues = 1;
            }

            AgentBufferSize     = 1024 * 8;
            AgentBufferPoolSize = 1024 * 200;
            GatewayQueueSize    = Environment.ProcessorCount * 500;
            InstanceID          = Guid.NewGuid().ToString("N");
        }
示例#2
0
 public Gateway()
 {
     HttpServer = new HttpApiServer();
     HttpServer.Options.Port = 8080;
     Filters = new Filters.FilterCenter(this);
     Routes  = new Routes.RouteCenter(this);
     Agents  = new Servers.ServerCenter(this);
 }
示例#3
0
 public Gateway()
 {
     HttpServer            = new HttpApiServer();
     Routes                = new Routes.RouteCenter(this);
     Agents                = new Servers.ServerCenter(this);
     this.PluginCenter     = new PluginCenter(this);
     this.Pluginer         = new Pluginer(this, null);
     Statistics.Server     = "Gateway";
     AgentMaxSocketError   = 3;
     MaxStatsUrls          = 20000;
     AgentMaxConnection    = 200;
     AgentRequestQueueSize = 2000;
     ThreadQueues          = (Environment.ProcessorCount / 2);
     if (ThreadQueues == 0)
     {
         ThreadQueues = 1;
     }
     GatewayQueueSize = Environment.ProcessorCount * 100;
     InstanceID       = Guid.NewGuid().ToString("N");
     GATEWAY_VERSION  = $"BeetleX/Bumblebee[{GetType().Assembly.GetName().Version.ToString()}]";
 }
示例#4
0
 public Gateway()
 {
     BufferPool.BUFFER_SIZE   = BufferSize;
     BufferPool.POOL_MAX_SIZE = PoolMaxSize;
     HttpServer            = new HttpApiServer();
     Routes                = new Routes.RouteCenter(this);
     Agents                = new Servers.ServerCenter(this);
     this.PluginCenter     = new PluginCenter(this);
     this.Pluginer         = new Pluginer(this, null);
     Statistics.Server     = "Gateway";
     AgentMaxSocketError   = 3;
     MaxStatsUrls          = 2000;
     AgentMaxConnection    = 200;
     AgentRequestQueueSize = 2000;
     ThreadQueues          = (Environment.ProcessorCount / 2);
     if (ThreadQueues == 0)
     {
         ThreadQueues = 1;
     }
     GatewayQueueSize = Environment.ProcessorCount * 500;
     InstanceID       = Guid.NewGuid().ToString("N");
 }
示例#5
0
 public Gateway()
 {
     HttpServer            = new HttpApiServer();
     Routes                = new Routes.RouteCenter(this);
     Agents                = new Servers.ServerCenter(this);
     this.PluginCenter     = new PluginCenter(this);
     this.Pluginer         = new Pluginer(this, null);
     Statistics.Server     = "Gateway";
     AgentMaxSocketError   = 3;
     MaxStatsUrls          = 20000;
     AgentMaxConnection    = 500;
     AgentRequestQueueSize = 500;
     ThreadQueues          = (Environment.ProcessorCount / 2);
     if (ThreadQueues == 0)
     {
         ThreadQueues = 1;
     }
     GatewayQueueSize = Environment.ProcessorCount * 100;
     InstanceID       = Guid.NewGuid().ToString("N");
     GATEWAY_VERSION  = $"beetlex.io";
     TimeoutFactory   = new TimeoutFactory(this);
 }
示例#6
0
        public Gateway()
        {
            HttpServer = new HttpApiServer();
            Filters    = new Filters.FilterCenter(this);
            Routes     = new Routes.RouteCenter(this);
            Agents     = new Servers.ServerCenter(this);
            HttpServer.Options.IOQueueEnabled = true;
            HttpServer.Options.UrlIgnoreCase  = false;
            AgentMaxSocketError     = 5;
            MaxStatsUrls            = 1000;
            AgentMaxConnection      = 300;
            AgentRequestQueueLength = 2000;
            int threads = (Environment.ProcessorCount / 2);

            if (threads == 0)
            {
                threads = 1;
            }
            multiThreadDispatcher = new BeetleX.Dispatchs.DispatchCenter <RequestAgent>(OnExecuteRequest,
                                                                                        Math.Min(threads, 16));
            AgentBufferSize     = 1024 * 8;
            AgentBufferPoolSize = 1024 * 200;
        }