Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jun : Keep-Alive, Connection and ProxyConnection...

www.cryer.info
Managed Newsgroup Archive

Keep-Alive, Connection and ProxyConnection...

Subject:Keep-Alive, Connection and ProxyConnection...
Posted by:"SD" (nospa..@please.it)
Date:Mon, 6 Jun 2005 17:02:50

Hi to all,
I've a serious problem with Indy (9.0.18) and following system:

Computer A (CA):
- Indy HTTP Client
- Proxy enabled

Computer B (CB):
- Indy HTTP Server
- Direct connection to a dial-up ISP (56K)

The (CA) send a lot of very short requests to (CB)
between Indy HTTP Client, enabled to work with a
proxy which don't require any password and username.

The only HTTP command used is GET and the request is
very simple:

- FHTTP.Get('/?method=GetTime);

The (CB), in the HTTPServer OnCommandGet, parse the request
object and fill the response with:

- AResponseInfo.ResponseNo := 200;
- AResponseInfo.ContentText := IntToStr(timeGetTime);
- AResponseInfo.ContentType := 'text/html';
- AResponseInfo.ContentLength := Length(AResponseInfo.ContentText);

All seem work fine, but at very very low speed, about 300-500ms for
a single GET request.

I've tried to overload the Server work in (CB) with a simultaneous call
of many CA instances (32) and I can see the MODEM data flow increase
but the response timing is always the same (this is been useful
to undestand that mine isn't a problem of low modem throughput
but only an effect of continuos: connect to server, disconnect from server.

At this point I've inserted in my client in (CA) the following lines:

- FHTTP.Request.Connection := 'keep-alive';
- FHTTP.Request.ProxyConnection := 'keep-alive';

to enable the keep-alive mode in client side.

The speed results aren't unfortunately changed again, so
I've tried to set the KeepAlive property of Server in (CB) with

FHTTPServer.KeepAlive := True;

but results are the same.

I've tried again to insert in HTTPServer OnCommandGet the
following lines:

- AResponseInfo.Response.Connection := 'keep-alive';
- AResponseInfo.Response.ProxyConnection := 'keep-alive';

but results are same again.

I've tried to debug INDY source step-by-step and I've
saw that in my:

FHTTP.Response.Connection I've found a '' (empty string);
FHTTP.Response.ProxyConnection I've found a 'close';

What I've to do to obtain a persistent connection by my
HTTP Client in (CA) and HTTP Server in (CB) ?

Thank you very much....
Silverio Diquigiovanni

Replies:

www.cryer.info
Managed Newsgroup Archive