[EMAIL PROTECTED] wrote:
> Now, since all exceptions are being swallowed by the
> TWSocket component, if I need to kill the entire app
> from, say, an event within the TWSocketThrdSrv (for
> example in OnBgException), should I post a message to
> the main thread, or is there a better way?

You may want to detect when the ServerThread terminates
in general the you can either restart the thread or
terminate the application depending on a flag or error
code sent in a custom message. In OnBgException the
flag or error can be set, something like that.

Procedure TServerThrd.Execute;
 Begin
   Try
     FSocketSrv := TWSocketThrdServer.Create(Nil);
     FSocketSrv.Listen();
     FSocketSrv.MessageLoop;
   Finally

     // Add
     FSocketSrv.Free;
     PostMessage(AppHwnd, WM_SERVERTHREAD_WILL_TERMINATE_SOON, ErrorCode, 
RestartMe); 
   End;
 End;
 
--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html





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

Reply via email to