This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: SO_KEEPALIVE


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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]