> I'm having good progress using the THttpCli component, but now I need to
> have a few things cleared in my mind:
>
> (1) I noticed THttpCli component always triggers it's OnRequestDone
> event when it finishes processing, no matter what caused this processing
> to stop (successfully finished downloading the document, stopped because
> of network error, stopped because I called Abort). Is this true? Is
> there a situation where processing finished but OnRequestDone is NOT
> called? Or the reverse, a situation where OnRequestDone is called but
> the component is not done?

OnRequestDone has been designed to be always triggered.


> (2) Can I use the ErrCode parameter of OnRequestDone as an reliable
> indicator of "normal processing"? I need to distinguish between normal
> "request done" and "request done" because of anything else. Abnormal
> request need to be retried, making use of HttpCli's ContentRangeBegin...

Yes, ErrCode is there to be tested. You should also test the StatusCode 
property. ErrCode mostly contains winsock type error code while StatusCode 
contain HTTP status code such as 404 (page not found).

> (3) If ErrCode is not an good indicator of error/success, is
> HttpCli.StatusCode an good indicator? (my guess is this not good)

You need to check both ErrCode and StatusCode. Think about ErrCode as a low 
level error (fro example unable to connect to remote host) while StatusCode 
is a high level error (404 page not found).

> (4) I noticed HttpCli.State = httpReady when the component is "ready".
> Is State ever httpReady in the course of normal processing?

Do not use the State property for anything else than showing in which state 
the protocol is (A kind of progress) or for debugging purpose. Use the 
events only to implement your application.

> My questions might be a bit dumb but I'm new to the concept of async
> processing in ICS and I need to make sure I get it right!

No problem. Your ask good question and we are here to help.

--
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

Reply via email to