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