Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Feb : Keep-Alive connection timeout/max requests.
| Subject: | Keep-Alive connection timeout/max requests. |
| Posted by: | "Arvid Haugen" (arv..@elis.no) |
| Date: | Tue, 19 Feb 2008 15:00:16 |
I have set "Keep-Alive" in the TidHTTPServer. This keeps the sockets open.
Is there any timeout for this connection, or a max number of requestes that
will be served for each connection?
Or do I need to program this myself? In case I have to implement it myself -
any suggestions how this should be done?
The reason why I am asking is that Apache implements this and I would like
to implement the same behavior. For Apache documentation:
KeepAlive
Syntax: KeepAlive max-requests
Default: KeepAlive 5
This directive enables Keep-Alive support. Set max-requests to the maximum
number of requests you want Apache to entertain per connection. A limit is
imposed to prevent a client from hogging your server resources. Set this to
0 to disable support.
KeepAliveTimeout
Syntax: KeepAliveTimeout seconds
Default: KeepAliveTimeout 15
The number of seconds Apache will wait for a subsequent request before
closing the connection. Once a request has been received, the timeout value
specified by the Timeout directive applies.
One other thing.
I downloaded the latest version of Indy today - 19/2.
In my project with a TidHTTPServer the connections are closed.
I have "Keep-Alive" set to true in the TidHTTPServer, I receive "Keep-Alive"
in ARequestInfo.Connection. But the webserver responds with
"closeconnection" (AResponseInfo.CloseConnection is true). I have tried both
with and without SSL.
Any idea why this happens and what I should do about it? Do I have to set
CloseConnection to false myself?
With the previous version I did not see this. That was the indy version
shipped with Delphi 2006.
/Arvid