info2004 wrote: > Arno, > > 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?
This is evil, don't do that, but use WSocket.MessageLoop instead, please read my previous message again. -- Arno Garrels > > Regards, > > Andy > Arno Garrels wrote: >> info2004 wrote: >>> In my thread (I know, you don't need threads...), in the execute >>> procedure, should I call WSocket.ProcessMessages, or >>> WSocket.MessagePump? >> >> TWSocket.ProcessMessages processes pending messages once and returns. >> You should call TWSocket.MessageLoop instead since it waits for >> and processes messages in a loop. Sending message WM_QUIT breaks the >> loop. Do not use TWSocket.ProcessMessages or TWSocket.MessagePump in >> a loop, that would slow down performance and result in high CPU use. >> >>> Are they the same? If not, what is the difference? >> >> No, TWSocket.MessagePump is a method that either calls >> Application.ProcessMessages or TWSocket.ProcessMessages depending >> on define "NOFORMS" or your custom message pump if event >> OnMessagePump >> is assigned. >> >> BTW: All this stuff has been moved in ICS v6 to TIcsWndControl. >> >> -- >> Arno Garrels [TeamICS] >> http://www.overbyte.be/eng/overbyte/teamics.html -- 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
