Markus Humm wrote:
> Hello Arno,
> 
> thanks for your replies!
> 
>>> FreeAndNil(a);
>> 
>> Oh, that's not a good idea, free it in SessionClose event.
> 
> Okay, will try this. In the OnSessionClosed of that instance
> a, right? Since the listening server socket won't get a session closed
> because he has no longer control about it.
> 
>> 
>>> 
>>> The other socket of the server still is in the listening state where
>>> I've left it since he was told to listen.
>> 
>> OK
>> 
>>> The client will notice it in its own timer because his keepalive
>>> requests won't be answered anymore.
>>> If the client detects this he
>>> starts another timer which tries every second to establish a
>>> connection to the same adress.
>> 
>> If the network cable is not plugged SessionClose event will be
>> triggered when you send something. If you detect a timeout call
>> Close and SessionClose will be triggered as well.
> 
> DepĆ¼ends on which side the cable is pulled when a switch is in
> between. 
> Only the side where the connection to the switch is lost will be
> notified, the other one has still a good connection: one to the
> switch! 
> So that can only be used partially.
> 
>> 
>>>> From SessionClose post a custom message and from the message
>>>> handler 
>> reconnect.
> 
> That would only work on the client side. But since a timeout thread
> for 
> those keepalive packets is needed anyway he can just wait until that
> fires. 

Correct, however since you designed your server to handle only a single
client connection it must reject any new connection attempt properly
as long as the timed out instance is still assigned.

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
> 
> 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

Reply via email to