Francois, and Arno,
while not terminated do
begin
WSocket.MessagePump;
// check if I need to do something
sleep(100);
end;
// close it all down
Or am I missing the point in the use of the message pump?
Yes, you miss something. The code you've done will be very slow at
processing
Why don't you write your own message pump with GetMessage? This way you can
process your custom messages as well.
Regards,
SZ
On Fri, Jul 18, 2008 at 10:08 AM, info2004 [EMAIL PROTECTED] wrote:
Francois, and Arno,
while not terminated do
begin
WSocket.MessagePump;
// check if I
Francois PIETTE wrote:
So in execute is it Ok to:
while not terminated do
begin
WSocket.MessagePump;
// check if I need to do something
sleep(100);
end;
// close it all down
Or am I missing the point in the use of the message pump?
Yes, you miss something. The code you've
info2004 wrote:
How would I implement a timeout? Do I create a timer component within
the thread, or is there a more elegant solution?
A timer is ok since your thread processes messages already :-)
You could, for example, use an integer that is incremented in timer's
event handler and reset it