> 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 done will be very slow at 
processing events because of the sleep. And it you remove the sleep, it will 
use all CPU.

The solution is simple: you need to use a real message loop. Easy: just call 
MessageLoop which all TWSocket instances have. To terminate the message 
loop, you can post a WM_QUIT message when you detect your thread has 

The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)

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

Reply via email to