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

 FSocket.Shutdown(SD_BOTH);

 EndTime := GetTickCount + FTimeout;
 while {$IFDEF USE_SSL} not FSSLShutdownComplete {$ELSE} False {$ENDIF} do
 begin
   if GetTickCount > EndTime then
     break;
   Sleep(10);
   FSocket.ProcessMessages;
 end;

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.


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

--
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