Here is the problem: Even though state = httpReady (this is what
DoRequestSync checks!), there are still messages pending--onrequestdone is
called later!!

If this was fixed, there would be no problem with mixing sync and async
methods. We just need an event which is the LASTEST message handler in
EVERY/ALL cases.

I know this is a design issue and not so easy but maybe you the more
experienced guys can come up with a solution that is easier than I think...



On 5/15/09, Arno Garrels <> wrote:
> Fastream Technologies wrote:
> > Do you think the code here is correct?:
> I think so. This code is only ever used with synchronous (blocking)
> methods. Synchronous methods should never be mixed with asynchronous
> methods, and if you use the synchronous methods do not call subsequent
> methods from within the event handlers but when the synchronous method
> actually returned like this:
> if not HttpCli1.Get then
>    //error
> else
>    HttpCli1.Head;
> With asynchronous methods you can safely call the next asynchronous
> method from OnRequestDone event handler.
> --
> Arno Garrels
> --
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to