Francois Piette wrote:
> I don't know of ANY component where it is safe to call the message pump from
> one of its event without knowing what happend. Even for a simple
> TButton.OnClick, you can get strange result if you call the message pump
> within the OnClick handler because the handler is re-entered. The problem is
> more visible with TWSocket since it is likely the event is always reentered
> because of the high rate network I/O has.
That's not entirely true. Delphi's GUI model is event-driven so I'm 
willing to bet ANY call to Application.ProcessMessages will be made as a 
result of handling an message or event. And I'm willing to bet most 
calls to Application.ProcessMessages can be traced to ether an 
TButton.OnClick event or a menu item's OnClick! And if it's such a big 
issue for ICS, why isn't there a simple 5-line-of-code test that would 
raise an exception if any code is re-entered?

Besides, I'm asking about such behavior because of the way the THttpCli 
component behaves for me. If you remember one of my earlier questions, I 
had lots of problems with the component failing to connect to my HTTP 
server. Using Ethereal I determined the connection is poor (lost 
packets, duplicate ACK's) BUT the component still averages an too high 
number of failed connections. I don't think I've had 5 consecutive 
"sessions" where no connections timed-out. And I'm saying the failure 
rate is too high because I never saw such a problem using my web 
browser. Not once! And after the time out expires and the component 
"aborts" and restarts it's Get, it usually finishes very very quickly. 
So I need to ask: Is there some other obvious thing I'm missing, like a 
call to Application.ProcessMessage? What else should I be looking for.

Cosmin Prund
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to