home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!usc!cs.utexas.edu!asuvax!ncar!noao!rstevens
- From: rstevens@noao.edu (W. Richard Stevens)
- Subject: Re: Problems with keepalive under SunOS 4.1.X
- Message-ID: <1993Jan4.121331.6119@noao.edu>
- Summary: default time is 2 hours
- Keywords: networking, SunOS
- Sender: news@noao.edu
- Nntp-Posting-Host: gemini.tuc.noao.edu
- Organization: National Optical Astronomy Observatories, Tucson, AZ, USA
- References: <chrisf.726116175@gerry>
- Date: Mon, 4 Jan 1993 12:13:31 GMT
- Lines: 19
-
- > int s = socket(AF_INET, SOCK_STREAM, 0);
- > int keepalive = 1;
- > setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive));
-
- This code is correct.
-
- >I make connection to another machine, block on a read, and unplug the other
- >machine ... and nothing happens. Any ideas?
-
- The default is 2 hours. Even after this 2 hour period, it'll take
- up to 10 minutes for the sender of the keepalive probes to determine
- that it can't get through to the other end.
-
- You can change this *on a per-kernel basis* (i.e., not on a per
- connection basis) on Suns by changing the appropriate variables
- in the file /usr/share/sys/netinet/in_proto.c and rebuilding the
- kernel.
-
- Rich Stevens (rstevens@noao.edu)
-