🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
2 messages
2 total messages Started by RAM Mon, 12 Dec 2005 08:33
How to avoid disconnections in each IdHTTP1->Get()?
#3004
Author: RAM
Date: Mon, 12 Dec 2005 08:33
16 lines
1287 bytes
Hello all !

I am using IdHTTP and I very surprised :
when I call [periodically]

 IdHTTP1->Get(URL); // URL is const string, IdHTTP1 is "connected" 
 
IdHTTP make "disconnecting"=>"connecting"=>"obtain data" and stay connected until next Get().

(I have tried IdHTTP1->Request->Connection="Keep-Alive"; // default for http 1.1
 before IdHTTP1->Connect(); - no changes.)

How to avoid disconnections in each IdHTTP1->Get()? 

Many thanks !
Re: How to avoid disconnections in each IdHTTP1->Get()?
#3006
Author: Remy Lebeau (TeamB)
Date: Mon, 12 Dec 2005 17:48
24 lines
1845 bytes
"RAM" <alexandr_ryzhov@energomash.ru> wrote in message
news:439d43dd$1@newsgroups.borland.com...

> I have tried IdHTTP1->Request->Connection="Keep-Alive"; // default for
http 1.1

Did you set the ProtocolVersion property to pv1_1?

Also, try using lower-case letters only:

    IdHTTP1->Request->Connection = "keep-alive";

> How to avoid disconnections in each IdHTTP1->Get()?

Keep-alives are a negotiated feature.  It is not enough for a request to ask
for it.  The server has to agree to it as well.  If the server does not
allow the keep-alive, then there is nothing you can do to keep the
connection alive between requests.  Look at the value of the
IdHTTP1->Response->Connection property to know what the server's reply to
the keep-alive is.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads