[Vortex] vortex connection

dexter dexter at koli.kando.hu
Wed Mar 12 10:35:10 CET 2008


Thanks for the answer.

Then, I'll do that create new channel thing, and wait for it to timeout.

Thx.

Balazs

Jens Alfke wrote:
> 
> On 11 Mar '08, at 3:50 AM, dexter wrote:
> 
>> It is not enough for me to set a callback handler when that particular
>> vortexconnection closes, because I'm simulating connection interruption
>> on the localhost with iptables, so I'm dropping all packets arriving at
>> the given port. In this way the vortexconnection won't be closed
>> properly so the callback won't be called at all.
> 
> The only way to detect a _completely_ broken connection like this is to 
> send data across the socket and wait for the TCP stack to time out 
> waiting for an ACK.
> 
> You can get the raw socket from the connection and call setsockopt to 
> enable TCP "keepalive" mode. This will cause TCP itself to send a packet 
> once in a while to check for connectivity. But IIRC, "once in a while" 
> only means every hour or so, which may not be timely enough for you. I 
> don't remember whether there's a way to customize the rate at which 
> keepalive checks.
> 
> Other than that, sending a message over a channel seems like your best bet.
> 
> —Jens



More information about the Vortex mailing list