2013-10-23 69 views
2

如何設置或增加連接限制或最大連接數限制?在篦條篩HttpServer工作線程的池大小我與創建:Grizzly HttpServer中的ConnectionLimit

HttpServer server = HttpServer.createSimpleServer(host, port); 

回答

2

有用於限制併發連接的數量沒有配置。 爲了調整內核或工作線程池,您需要獲取傳輸。

HttpServer server = ... 
// The default network listener is named grizzly when 
// creating a server via the factory method 
NetworkListener l = server.getNetworkListener("grizzly"); 
TCPNIOTransport transport = l.getTransport(); 

// You can make changes to the kernel thread pool 
// by calling transport.getKernelThreadPoolConfig(). 
// Changes to the worker thread pool via 
// transport.getWorkerThreadPoolConfig(). 

Java文檔的上面可以發現here

如果您確實需要能夠限制併發連接數,我建議在灰熊用戶的郵件list

跟進