home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / programm / 5815 < prev    next >
Encoding:
Text File  |  1993-01-04  |  1.2 KB  |  34 lines

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