home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / programm / 5813 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  1.3 KB

  1. Path: sparky!uunet!munnari.oz.au!metro!otc!gerry!chrisf
  2. From: chrisf@nms.otca.oz.au (Christopher Fraser)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Problems with keepalive under SunOS 4.1.X
  5. Keywords: networking, SunOS
  6. Message-ID: <chrisf.726116175@gerry>
  7. Date: 4 Jan 93 02:56:15 GMT
  8. Sender: news@otc.otca.oz
  9. Lines: 29
  10.  
  11. Hi,
  12.  
  13. I'm trying to get keepalive working on SOCK_STREAM sockets under SunOS 4.1.X.
  14. To turn on keepalive I'm using (and I may be wrong, the Sun documentation
  15. is a bit vauge):
  16.  
  17.   int s = socket(AF_INET, SOCK_STREAM, 0);
  18.   int keepalive = 1;
  19.   setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive));
  20.  
  21. I make connection to another machine, block on a read, and unplug the other
  22. machine ... and nothing happens. Any ideas? I'd especially appreciate pointers
  23. to more comprehensive documentation.
  24.  
  25. Even if I can get keepalive working, the default time out seems to be an hour:
  26.  
  27.   #define TCPTV_KEEP_IDLE (120*60*PR_SLOWHZ)   /* dflt time before probing */
  28.  
  29. which isn't much use for me. How does one change this value? Can it be changed?
  30.  
  31. If it can't, is there some way I can generate the probes myself?
  32.  
  33. If you've got any ideas, please email. I'll summarise if there is sufficient
  34. interest.
  35.  
  36. Cheers,
  37. --
  38. Christopher Fraser      "First time surrealists are often confused by the
  39. chrisf@nms.otca.oz.au    similarities between fish and telephones"
  40.