>> HM>   while (GetTickCount-t < 100) do
>> HM>   begin
>> HM>     TranslateMessage(MsgRec);
>> HM>     DispatchMessage(MsgRec);
>> HM>     WaitMessage; 
>> HM>   end;

This doesn't look like a proper message loop.
Waiting 100mS for shutdown to complete is probably much much too short !
--
[EMAIL PROTECTED]
http://www.overbyte.be


----- Original Message ----- 
From: "Humm, Markus" <[EMAIL PROTECTED]>
To: "ICS support mailing" <twsocket@elists.org>
Sent: Thursday, February 02, 2006 2:24 PM
Subject: Re: [twsocket] still problems with terminating the socket


>> Hello Markus,
>> 
>> Seems you don't get the Event-driven way of programming, why a loop of
>> 100ms that seems to do nothing with event it could receive ?
>> 
>> HM> - output a debug message to eventlog
>> HM> - socket.shutdown(1);
>> HM> - output a 2nd message to eventlog
>> HM> - do this:
>> HM>   t:=GetTickCount;
>> HM>   while (GetTickCount-t < 100) do
>> HM>   begin
>> HM>     TranslateMessage(MsgRec);
>> HM>     DispatchMessage(MsgRec);
>> HM>     WaitMessage; 
>> HM>   end;
>> HM> - output a 3rd message to eventlog
>> HM> - Socket.Release;
>> 
>> HM> But: it doesn't even get to the 2nd message!
>> HM> I will put a message in my OnSessionClosed  event as well.
>> 
> 
> I did that on some recommendation, because the OnSessionClosed might 
> not occur so nobody would release the socket then. So I'm waiting
> that 100ms to release that socket if not already done. (okay this is 
> not yet correct here but he doesn't come to that line yet so it doesn't 
> matter just now.) He doesn't seem to fire OnSessionClosed! He seems to
> hand 
> at the socket.shutdown call.
> 
> I will check next the thread ids as recommendet by somebody else.
> 
> Greetings
> 
> Markus
> -- 
> 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
-- 
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