Re: [Simpleweb-Support] socket timeout
Brought to you by:
niallg
From: Niall G. <nia...@an...> - 2004-09-01 09:11:01
|
Hi Petro, > When a client connects to the simple server, the socket is closed 5 > seconds later if no request is received. By default this is done to keep the resource consumption low when the server is very heavily loaded. To increase the duration the Poller can remain active you must configure a PipelineHandler like so. ProtocolHandler server = new MyProtocolHandler(); PipelineHandler handler = PipelineHandlerFactory.getInstance(server, 10, 5000); Connection con = ConnectionFactory.getConnection(handler); In the above statement I am creating a PipelineHandler that uses 10 Poller objects to poll incoming connections, these Pollers will be idle for no longer than 5 seconds. By default a Poller will only ever be idle for 1 second. One thing to note is that if you set the maximum idle time for Poller objects to 5 seconds or more you will experience a noticeable delay before a response is sent by the server, this is because the Poller responsible for the connection may be in a wait queue for up to the maximum idle time, regardless of the load on the server. An alternative, which I use when using HTTP Basic Authentication and SSL is to use a special Poller implementation called the GranularPoller. You must have Simple 2.4.2 or above. To use this poller the system property simple.http.poller must be set to simple.http.GranularPoller, try this: java -Dsimple.http.poller=simple.http.GranularPoller With this you will not need to create a custom PipelineHandler as this will perform a much larger number of poll iterations. Hope this helps, Niall |