[Ace-users] [ace-users] ACE not detecting connection closing with keepalive enabled

Matthew Gillen mgillen at bbn.com
Mon Dec 3 09:44:32 CST 2007

Douglas C. Schmidt wrote:
>> This works fine both on windows and linux - when I disconnect peer's =
>> network cable, handle_close() is called within 4-8 seconds.
>> If I send something through that socket before handle_close() is called, =
>> but after I disconnected the peer's network cable, handle_close() is =
>> sometimes called after 20 minutes or so. This behavior is observed only =
>> on linux, on windows my code works exactly as expected - connection =
>> failure is detected always. The only platform dependent code I have is =
>> stated above. Everything else is the same on windows and linux. The =
>> version it worked for on windows is 5.5.4. I tried 5.5.4, 5.5.3 and =
>> 5.6.1 on linux and got the same result.
>> Hope you can help by either clarifying something I'm missing or if this =
>> is a bug in ACE.

Doug's right, it's a linux issue not an ACE issue.

That said, you might try using either NetworkManager or ifplugd.  Windows by
default detects when there's no ethernet cable and disables the interface,
thus accelerating network failure messages.  Older linux distros don't, so the
interface stays "up" even when the plug is pulled.  Which way is "right" is
debatable, and depends on what you're trying to do (for your case, it looks
like you'd prefer the Windows behavior).  The two programs I mentioned add the
"take the interface down when the cable is unplugged" functionality to linux.


More information about the Ace-users mailing list