This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: SO_KEEPALIVE
- To: "Chua, Han-por" <HanPor dot Chua at comverse dot com>
- Subject: Re: [ECOS] SO_KEEPALIVE
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Date: Thu, 4 Oct 2001 13:31:04 +0200
- Cc: ecos-discuss at sources dot redhat dot com
- References: <3BBC4213.74FBAFBF@comverse.com>
On Thu, Oct 04, 2001 at 07:03:48PM +0800, Chua, Han-por wrote:
> Hi All,
>
> Does anyone of you guys know how to alter the default SO_KEEALIVE time
> which is 2 hours?
> 2 hours is too long to wait before reporting the connection was broken.
>
> Thanks
> Chua
/*
* HORRIBLE HACK WARNING !?!?!?!
*
* The TCP keepalives are set for 2 hours. After two hours of
* inactivity, a probe will be sent to see if the other side is still
* alive. We are finding that 2 hours is too long and we run out of
* sockets. So we want to reduce this 2 hours to something
* shorter. Normally to do this you call a sysctrl function. But, the
* eCos port of OpenBSD does not support this call. So instead, we
* directly poke around in the network stacks variables. This is
* highly unportable, so expect this to break if you are not using a
* true BSD stack.
*/
{
#include <sys/protosw.h>
extern int tcp_keepidle;
tcp_keepidle = 2*60*PR_SLOWHZ; /* 2 minutes */
}
return TRUE;
}