home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!olivea!hal.com!decwrl!rtech!ingres!sweeney
- From: sweeney@Ingres.COM (Tony Sweeney)
- Newsgroups: comp.protocols.tcp-ip
- Subject: Re: server that won't die (normally)
- Message-ID: <1992Sep3.140859.11684@pony.Ingres.COM>
- Date: 3 Sep 92 14:08:59 GMT
- References: <1992Sep01.205851.29040@mixcom.com>
- Reply-To: sweeney@Ingres.COM (Tony Sweeney)
- Distribution: usa
- Organization: Ask Computer Systems Inc., Ingres Division, Alameda CA 94501
- Lines: 30
-
- In article <1992Sep01.205851.29040@mixcom.com> mgic@mixcom.mixcom.com (mgic) writes:
- >
- >System: RS/6000 AIX 3.2.1
- >
- >I've written a server that is started by inetd, reading
- >and writing stdin and stdout.
- >
- >The server uses select() to determine when data is
- >ready to be read. If an (socket) error is detected,
- >the server quits.
- >
- >The problem is that the server never dies if the client
- >quits abnormally. When the client quits normally, it sends
- >the server an "end of session" message, and the server quits normally.
- >
- >Why isn't the server being informed that the client no longer exists
- >so that select() will report an error? Or, what method should
- >be used to determine if the stream no longer exists?
- >
- You want to setsockopt(..., ..., SO_KEEPALIVE, ..., ...); The select will
- (eventually) return an error. Note that the keepalive time is a kernel
- parameter and cannot be set by the user.
- >Thank you.
- >
- >Dean
- >--
-
- Hope this isn't too wide of the beam.
-
- Tony.
-