Return to BSD News archive
Xref: sserve comp.unix.programmer:15510 comp.unix.bsd:13526 Newsgroups: comp.unix.programmer,comp.unix.bsd Path: sserve!newshost.anu.edu.au!munnari.oz.au!bruce.cs.monash.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!gatech!swrinde!sgiblab!brunix!mws From: mws@cs.brown.edu (Mike Shapiro) Subject: Re: Detecting dead client in BSD socket Message-ID: <1994Mar4.183437.4001@cs.brown.edu> Sender: news@cs.brown.edu Organization: Brown University Department of Computer Science References: <1994Mar3.154852.24090@il.us.swissbank.com> <VIXIE.94Mar4000717@office.home.vix.com> Date: Fri, 4 Mar 1994 18:34:37 GMT Lines: 15 In article <VIXIE.94Mar4000717@office.home.vix.com> vixie@vix.com (Paul A Vixie) writes: >to get your kernel to find out whether the connection is alive when idle: > >{ int on = 1; setsockopt(s, IPPROTO_TCP, SO_KEEPALIVE, &on, sizeof(int)); } The manpage on setsockopt says that SO_KEEPALIVE uses periodic transmission of messages to determine whether the connection has been broken, and if no response has been received, sends the process a SIGPIPE. But does anyone know specifically how long it will take to detect that the connection has been broken? Is this reliable or guaranteed by the system? I'm using Solaris 5.3. Thanks, -Mike -- Mike Shapiro Box 6198 Brown Univ. Providence RI 02912 mws@cs.brown.edu