home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!think.com!yale.edu!jvnc.net!aggarwal
- From: aggarwal@tigger.jvnc.net (Vikas Aggarwal)
- Subject: Question on daemon's under inetd
- Message-ID: <1992Dec24.064005.5831@tigger.jvnc.net>
- Summary: Want to make daemons from inetd wait for a period of time
- Originator: aggarwal@nisc.jvnc.net
- Keywords: inetd daemons
- Sender: news@tigger.jvnc.net (Zee News Genie)
- Nntp-Posting-Host: nisc.jvnc.net
- Organization: JvNCnet
- Date: Thu, 24 Dec 1992 06:40:05 GMT
- Lines: 31
-
- In the past, I have come across several inetd daemons that are
- started up by inetd when a connection on the particular port
- comes in, and then *wait* for a small period of time
- listening for any more incoming connections on their port before
- exiting after a period of inactivity.
-
- To me, this seems like an excellent idea- achieves the best of both
- arguments (standalone via inetd daemon-- startup time vs. inactivity).
-
- However (obviously), when I tried to do the same with a TCP daemon
- that I wrote, the 'accept' call errored with 'socket not connected'.
- I was doing an 'accept' on the file descriptor 0 handed to me by
- 'inetd'. Processing the first connection worked fine, but then I went
- back to listening on the stdin (file desc 0 handed by inetd), the
- accept() call returned immediately.
-
- I tried playing around with the 'wait' vs. 'nowait' in the inetd.conf
- file, but that did not help. Do I have to set some option on the
- stdin/socket or open another socket and bind to it (as I would do in
- a standalone server) ? Can't I reuse the file descr 0 handed to me by
- 'inetd' ??
-
- Thanks, and appreciate emailing responses back to me also. Apologies if
- this is an easy one and been discussed already.
-
-
- -vikas Network Engineering
- vikas@jvnc.net (609) 258-2403
- ...rutgers!jvncnet!vikas (609) 258-2424 (fax)
- JvNCnet, Princeton, NJ
- -----------------------------------------------------------------------------
-