home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / misc / 4610 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  1.7 KB

  1. Xref: sparky comp.unix.misc:4610 comp.sys.next.programmer:7792
  2. Path: sparky!uunet!think.com!paperboy.osf.org!hsdndev!dartvax!fermat.dartmouth.edu!lusty
  3. From: lusty@fermat.dartmouth.edu (Diana Shoemaker)
  4. Newsgroups: comp.unix.misc,comp.sys.next.programmer
  5. Subject: Need help with setsockopt
  6. Message-ID: <1992Dec17.033142.17836@dartvax.dartmouth.edu>
  7. Date: 17 Dec 92 03:31:42 GMT
  8. Sender: news@dartvax.dartmouth.edu (The News Manager)
  9. Organization: I could use some organization
  10. Lines: 35
  11.  
  12.  
  13. I have a program into which I'm attempting to install
  14. an implementation of the ident code to query a remote
  15. username on a connection to my machine, which is a
  16. NeXTstation.  This code was not written by me, and
  17. I'm struggling to figure out why it's not working.
  18. It has come to the point where I think it may be a
  19. NeXT-specific problem.  Specifically, the two lines
  20. that attempt to set socket options, fail to set the
  21. options, i.e., they get a return value of -1.  The
  22. two lines are as follows:
  23.  
  24. setsockopt(id->fd, SOL_SOCKET, SO_LINGER, 0, 0)
  25. setsockopt(id->fd, SOL_SOCKET, SO_REUSEADDR, 0, 0)
  26.  
  27. above those lines is this one:
  28.  
  29. id->fd = socket(AF_INET, SOCK_STREAM, 0)
  30.  
  31. The original implementation of this code had
  32. SO_DONTLINGER instead of SO_LINGER, but on my machine
  33. SO_DONTLINGER is not available, so I have substituted
  34. SO_LINGER, without making any other changes.  I have no
  35. idea whether this was the appropriate response ;).
  36.  
  37. I should point out that when I comment out the 2
  38. setsockopt lines I can successfully get the username...
  39. *once*.  Further queries on the same connection fail
  40. to return the username.
  41.  
  42. I know I haven't supplied much information here, but
  43. does anybody have any idea what I should try in order
  44. to get this to work?
  45.  
  46. Lusty
  47.