home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!hri.com!noc.near.net!vaxeline.ftp.com!cream.ftp.com!jbvb
- From: jbvb@vax.ftp.com (James B. VanBokkelen)
- Newsgroups: comp.protocols.tcp-ip
- Subject: Re: Problems detecting a dead client connections ??????
- Keywords: TCP crashes
- Message-ID: <921229150500@cream.ftp.com>
- Date: 29 Dec 92 20:05:00 GMT
- References: <1992Dec29.161908.951@nsisrv.gsfc.nasa.gov>
- Sender: root@vaxeline.ftp.com (vaxeline.ftp.com root account)
- Reply-To: jbvb@ftp.com
- Organization: FTP Software, Inc., Wakefield, MA
- Lines: 42
- Nntp-Software: PC/TCP NNTP
- Nntp-Posting-Host: whipped-cream.ftp.com
-
- In article <1992Dec29.161908.951@nsisrv.gsfc.nasa.gov> sylvain@killians.gsfc.nasa.gov (Gregory Sylvain) writes:
-
- The problem manifests itself when the client end of a tcp client/server
- connection desides to "go away". (By "go away", this could mean that the
- client crashed or that the client actually closed the connection with a
- successfull call to shutdown(2).)
-
- I'm not a real 4bsd internals expert, but as I understand shutdown(2), it
- should send a FIN, initiating a normal TCP connection close handshake.
-
- Given that the connection is non-blocking on both ends. And provided that
- the server isn't reading or writing from the socket at the time the client
- crashes, THE SERVER WILL NEVER DETECT THAT THE CLIENT ISN'T THERE ANYMORE.
-
- This is true regardless of the blocking/non-blocking state of either end
- of the connection, when one end's operating system (or TCP) crashes, or
- network connectivity is suddenly lost.
-
- The next time around, when the server tries to read from the socket,
- the server will get an EWOULDBLOCK. This make some sense, since there
- obviously isn't any infomation left to read. But why wont the server
- get an error more like ECONNRESET or ECONNABORTED.
-
- Ya pays yer penny and gets yer choice...
-
- If you don't mind a steady stream of "keepalive" packets the whole time the
- connection is open, then most TCPs will give you an indication when they
- haven't gotten any traffic in some time T, whose exact value may be fixed
- or configurable depending on the implementation. On an SGI or other
- 4bsd-derived TCP, read up on SO_KEEPALIVE. You might find that it is
- easier to design the application protocol with a NOOP command, which can be
- used to check connection liveness instead of a TCP keepalive.
-
- But this may well annoy (or bankrupt) users of PayPerPacket networks, or
- those with Dial On Demand serial links. They'll want you to design your
- application-layer protocol so that each end has some way of giving up after
- waiting "too long", without probing the connection at all.
-
- In short, if you need to know the state of the connection, you need traffic
- of one sort or another, which has a cost.
-
- James B. VanBokkelen 2 High St., North Andover, MA 01845
- FTP Software Inc. voice: (508) 685-4000 fax: (508) 794-4488
-