From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,cdab6f0e630dcb26 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-05-10 19:01:46 PST Path: bga.com!news.sprintlink.net!hookup!swrinde!sdd.hp.com!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.sys.dec Subject: Re: annoyingly persistant TCP connections Date: 10 May 1994 22:05:29 GMT Organization: Thinking Machines Corporation, Cambridge MA, USA Message-ID: <2qp0f9INNbt1@early-bird.think.com> References: NNTP-Posting-Host: telecaster.think.com In article mikew@gopher.dosli.govt.nz (Mike Williams) writes: > The problem is that if the client crashes for any reason (which it does, > reasonably often), the TCP connection is not destroyed, and the server > stays around with it's stdout stream blocked. Funnily enough, when the > PC is rebooted, the connection springs into life again, the conversation > completes, and the server retires peacefully. > > * I'm surprised that the connection isn't closed when the client > application dies. Is this a bug in the TCP/IP implementation? (on > either the PC or Ultrix end) When you say "the client crashes", do you mean the just application dies, or the whole PC crashes? If the PC crashes, there's no way for the server to know this. It will continue to try sending the reply, waiting for the client to acknowledge it. There should be a timeout, so eventually it should realize that the client is never going to acknowledge. But maybe you're rebooting the PC before this timeout occurs (some systems may have very long timeouts). If the PC stays up but the application dies, it sounds like a problem with the WSOCKETS library not closing the connection when the application dies. When you reboot the PC, the next retransmission by the server causes it to send a RST (reset) to indicate that the connection no longer exists, which causes the server to realize that the client died. > * Is there any way my server can detect when the client dies? If the PC TCP/IP implementation has this limitation, probably not without an application-level solution. > * Can anyone suggest a better protocol which would avoid these problems? Require the client to reply to the server's response. The server could then have its own application-level timeout. -- Barry Margolin System Manager, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar