[Vortex] vortex connection
Jens Alfke
jens at mooseyard.com
Tue Mar 11 16:16:22 CET 2008
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1875 bytes
Desc: not available
Url : http://lists.aspl.es/pipermail/vortex/attachments/20080311/54bdbcc7/attachment.bin
More information about the Vortex
mailing list