Does anyone have ideas why TIcsWndControl.ProcessMessages could
hang sometimes when socket is used in separate thread?

Actually ProcessMessages probably doesn't hang. ProcessMessages it the place
from where all events are called. It is likely an event handler which is
blocking. You should try to find out where.

I call it like this, the only event that is called is SslShutDownComplete which sets FSSLShutdownComplete property, I don't have any other event processing here


 EndTime := GetTickCount + FTimeout;
 while {$IFDEF USE_SSL} not FSSLShutdownComplete {$ELSE} False {$ENDIF} do
   if GetTickCount > EndTime then

I don't know from where this code is called, but it CANNOT be called from an event handler originating from TWSocket.

ProcessMessage is actually calling the window procedure for all windows created in the thread context and in turn trigger events at the component level. If any event hanlder is blocking, the ProcessMessages looks blocking. Calling Synchronize will actually block the thread until the main thread has time to process a message.

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
Visit our website at

Reply via email to