Re: [twsocket] Help on ICS's HTTP client component

2006-11-11 Thread Francois PIETTE
 So that's the end of it. It's the server that's causing my troubles...

Good to know.

 Is it worth using different time-out's for different stages of
 connection? Ex: use a long timeout for DNS queryes, use shorter timeout
 for the connection itself, use long timeouts for data transmission itself?

There is no general rule. It depends on what your application does.
I use a simple timout, something like 30. I start the timer before doing 
anything and then restart it in each step, including when data is received. 
If the timer triggers, then there was 30 since the last activity, whatever 
it was.

When a timeout is detected, I usually retry 3 times before letting the user 
know. After 3 retries, I just tell the user something goes wrong and he must 
try later. I record detailled errors in the log file but I do not bother the 
user with the details. I just say - like Microsoft - The service is 
currently unavailable, try later.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Help on ICS's HTTP client component

2006-11-10 Thread Cosmin Prund
Hello everyone.


Note:
This is a re-post of a message sent to the Talk list, with more detail
on the problem. This message gets sent the second time to this list too. 
  I sent the first one before receiving elist's subscription 
confirmation so I don't think it went through.

I'm having some trouble using the THttpCli component from the ICS suite. 
I'm using this component to simply download a document off a web site 
(the document might be a configuration file or a compressed DLL file 
or whatever). It mostly works but some times it just stops (gets stuck 
in a state - the last OnChangeState message I'm getting is 
httpDnsLookupDone) and then nothing happens. My application's GUI 
doesn't get stuck because Application's message pump is working, but the 
download doesn't finish ether. Or, if something does happen, I know 
nothing about it... Please note I'm using GetAsync to get my document.

Extra information:

I'm using the version of ICS marked [ Download the latest ICS-V5
Distribution ] on http://www.overbyte.be/frame_index.html. Is V6 for
general consumption? Should I try that?
The web server I'm accessing is likely not the cause for this problem as
the server is an Apache server running on a Windows machine on my LAN.

I did implement a kind of time-out mechanism into my download thing: if
no event is triggered for a given amount (no state change, no data
received, no error) I consider the connection to be timed out. This
gets my application back on the track working properly but this feels
like a hack, it doesn't seem to be the right thing to do. Please correct
me if I'm wrong!

Thanks,
Cosmin Prund

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Help on ICS's HTTP client component

2006-11-10 Thread Francois Piette
 I did implement a kind of time-out mechanism into my download thing: if
 no event is triggered for a given amount (no state change, no data
 received, no error) I consider the connection to be timed out. This
 gets my application back on the track working properly but this feels
 like a hack, it doesn't seem to be the right thing to do. Please correct
 me if I'm wrong!

You should always implement timeout. Altough in your particular case, there
may be a problem somewhere else. I suggest you use a sniffer to see why the
connection doesn't establish with the webserver (The next state after
httpDnsLookupDone is the connection). Using a sniffer (I suggest Ethereal,
link from the links page at ICS website), you'll be able to see if the
connection request packet is sent by your program and if the reply (positive
or refused) come back from server. I guess the reply doesn't come back. Once
we know that information, we'll be able to diagnose further.

btw: You may also try to use the same URL and same server with the demo
program HttpTst provided with ICS to see if it happends or not. If it
doesn't happend with HttpTst demo, then it is likely there is something
wrong with your code. If it happend with HttpTst, it is likely a problem of
the webserver, of a security product (firewall, antivirus,...) or maybe you
found a bug (Then trying with V6 beta could be useful since this version has
the latest code available).

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be


- Original Message - 
From: Cosmin Prund [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Friday, November 10, 2006 3:13 PM
Subject: [twsocket] Help on ICS's HTTP client component


 Hello everyone.


 Note:
 This is a re-post of a message sent to the Talk list, with more detail
 on the problem. This message gets sent the second time to this list too.
   I sent the first one before receiving elist's subscription
 confirmation so I don't think it went through.

 I'm having some trouble using the THttpCli component from the ICS suite.
 I'm using this component to simply download a document off a web site
 (the document might be a configuration file or a compressed DLL file
 or whatever). It mostly works but some times it just stops (gets stuck
 in a state - the last OnChangeState message I'm getting is
 httpDnsLookupDone) and then nothing happens. My application's GUI
 doesn't get stuck because Application's message pump is working, but the
 download doesn't finish ether. Or, if something does happen, I know
 nothing about it... Please note I'm using GetAsync to get my document.

 Extra information:

 I'm using the version of ICS marked [ Download the latest ICS-V5
 Distribution ] on http://www.overbyte.be/frame_index.html. Is V6 for
 general consumption? Should I try that?
 The web server I'm accessing is likely not the cause for this problem as
 the server is an Apache server running on a Windows machine on my LAN.

 I did implement a kind of time-out mechanism into my download thing: if
 no event is triggered for a given amount (no state change, no data
 received, no error) I consider the connection to be timed out. This
 gets my application back on the track working properly but this feels
 like a hack, it doesn't seem to be the right thing to do. Please correct
 me if I'm wrong!

 Thanks,
 Cosmin Prund

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be