BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WinInet Queries

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
'I' as in From Bored Land
Guest





PostPosted: Wed Dec 08, 2004 12:02 pm    Post subject: WinInet Queries Reply with quote



Hi Folks,

It is christmas time and as usual I am here with a bag full of queries like
a "Query Santa with no Claus(e) whatsoever" Wink. Before I get on to my
queries here is a wish to all of you - Merry Christmas (Not sure if I would
be around Christmas time so very well in advance) - Have a nice time.

Okay now for the goodies .. ooops queries rather:

I have been toying around with WinInet library for a specific project. Well
the project is completed by somebody else and I have been given the
unfortunate task of post-mortem and fixing somebody else's code. Okay before
I get brooding on how I hate this and bore you - I shall ask my queries:

Background:
-------------
The application needs to connect to a secure site and retreive data packets
at regular intervals. The interval itself could vary based on some other
requests posted to the same server. Yes - The application would have
multiple connections opened to the same site. Request B would be fired and
the response that is received from this would include the data when Request
A should be fired. So given this Request B and Request A would be firing at
regular intervals. While Request B's interval is constant (around 30 seconds
or so) - Request A's would be a variant (varies from 10 seconds to 180
seconds).

The implementation is based on a Thread timer - Thread A (Request A) and
Thread B (Request B) would kick start in the Execute method and perform the
required operations.

So based on this - here are the details that I would love to get your
opinions for:

a) Everytime there is a need to download the message from the server, an
InternetConnect is performed and on downloading the response it is closed.
Is this better OR should InternetConnection be established once and for
further requests re-used ? Now since it is a SSL site - there could be
timeout attached to a connection right ?

Which mechanism would best optimize the connection to the server (both from
client point of view and server point of view ie.) ?

b) There is a flag called INTERNET_FLAG_KEEP_CONNECTION - What is the funda
behind this ? Since it is Request based - I assumed that the Request
connection is kept active till InternetCloseHandle of the Request is given
(else would it close the connection immediately after the HttpSendRequest is
performed) - Am I right ? If yes then Can the same Request handle be used
subsequently ? (Can I store the Request handle and re-use it for subsequent
calls ? Is it safe ? What I meant to say here - can I postpone calling of
InternetCloseHandle for this Request - Would it better performance in any
way ?).

That is it for now.
Awaiting response.
Thank you and Warm Regards


Back to top
'I' as in From Bored Land
Guest





PostPosted: Thu Dec 09, 2004 7:55 am    Post subject: Re: WinInet Queries Reply with quote



??

Am I at a wrong place ?

"'I' as in From Bored Land" <noemail (AT) forspamcontrol (DOT) com> wrote

Quote:
Hi Folks,

It is christmas time and as usual I am here with a bag full of queries
like
a "Query Santa with no Claus(e) whatsoever" Wink. Before I get on to my
queries here is a wish to all of you - Merry Christmas (Not sure if I
would
be around Christmas time so very well in advance) - Have a nice time.

Okay now for the goodies .. ooops queries rather:

I have been toying around with WinInet library for a specific project.
Well
the project is completed by somebody else and I have been given the
unfortunate task of post-mortem and fixing somebody else's code. Okay
before
I get brooding on how I hate this and bore you - I shall ask my queries:

Background:
-------------
The application needs to connect to a secure site and retreive data
packets
at regular intervals. The interval itself could vary based on some other
requests posted to the same server. Yes - The application would have
multiple connections opened to the same site. Request B would be fired and
the response that is received from this would include the data when
Request
A should be fired. So given this Request B and Request A would be firing
at
regular intervals. While Request B's interval is constant (around 30
seconds
or so) - Request A's would be a variant (varies from 10 seconds to 180
seconds).

The implementation is based on a Thread timer - Thread A (Request A) and
Thread B (Request B) would kick start in the Execute method and perform
the
required operations.

So based on this - here are the details that I would love to get your
opinions for:

a) Everytime there is a need to download the message from the server, an
InternetConnect is performed and on downloading the response it is closed.
Is this better OR should InternetConnection be established once and for
further requests re-used ? Now since it is a SSL site - there could be
timeout attached to a connection right ?

Which mechanism would best optimize the connection to the server (both
from
client point of view and server point of view ie.) ?

b) There is a flag called INTERNET_FLAG_KEEP_CONNECTION - What is the
funda
behind this ? Since it is Request based - I assumed that the Request
connection is kept active till InternetCloseHandle of the Request is given
(else would it close the connection immediately after the HttpSendRequest
is
performed) - Am I right ? If yes then Can the same Request handle be used
subsequently ? (Can I store the Request handle and re-use it for
subsequent
calls ? Is it safe ? What I meant to say here - can I postpone calling of
InternetCloseHandle for this Request - Would it better performance in any
way ?).

That is it for now.
Awaiting response.
Thank you and Warm Regards





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.