*BSD News Article 28148


Return to BSD News archive

Xref: sserve comp.unix.programmer:15535 comp.unix.bsd:13530
Path: sserve!newshost.anu.edu.au!munnari.oz.au!bruce.cs.monash.edu.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!charnel!xmission!u.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (Terry Lambert)
Newsgroups: comp.unix.programmer,comp.unix.bsd
Subject: Re: Detecting dead client in BSD socket
Date: 5 Mar 1994 04:41:46 GMT
Organization: Weber State University, Ogden, UT
Lines: 18
Message-ID: <2l92ia$hrd@u.cc.utah.edu>
References: <1994Mar3.154852.24090@il.us.swissbank.com>
NNTP-Posting-Host: cs.weber.edu
Keywords: socket bsd death

In article <1994Mar3.154852.24090@il.us.swissbank.com> leed@il.us.swissbank.com (Dwight Lee) writes:
>Is there a way to determine, from the server side, whether a client has
>closed its end of the connection in a BSD socket?

Set SO_KEEPALIVE as an option and notification will be more immediate; be
sure and use select on the socket and check for exceptional conditions.

On the other hand, if it's a socket library on top of TLI and your UNIX
obeys the notification protocol, rewriting directly to TLI will let you
not only run on other protocol stacks (XNS, IPX, OSI, etc.), it will
provide disconnect notification.


					Terry Lambert
					terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.