* annoyingly persistant TCP connections
@ 1994-05-06 4:43 Mike Williams
1994-05-10 22:05 ` Barry Margolin
0 siblings, 1 reply; 2+ messages in thread
From: Mike Williams @ 1994-05-06 4:43 UTC (permalink / raw)
We have a PC client which talks to a unix-based server via TCP. The
client use a DLL called WSOCKETS, provided with DEC Pathworks 4.1. The
server is an oraperl script which is started from inetd(8) (if that's
relevant). The server host is a DECstation running Ultrix 4.3A.
The protocol is simple: the client sends a (known-length) request to the
server, which sends back a (variable-length) reply before exiting.
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.
So, I'm stumped for solutions, and request the wisdom of benevolent
TCP/IP gurus.
* 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)
* Is there any way my server can detect when the client dies?
* Can anyone suggest a better protocol which would avoid these problems?
Help!
------------------------------------------------------------------
Mike Williams, Dept of Survey & Land Information, NZ.
Email: <mikew@gopher.dosli.govt.nz> Phone: +64 4 471 0380
"Buy one for the price of two and get the second one FREE!!"
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: annoyingly persistant TCP connections
1994-05-06 4:43 annoyingly persistant TCP connections Mike Williams
@ 1994-05-10 22:05 ` Barry Margolin
0 siblings, 0 replies; 2+ messages in thread
From: Barry Margolin @ 1994-05-10 22:05 UTC (permalink / raw)
In article <MIKEW.94May6164357@pooh.dosli.govt.nz> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1994-05-10 22:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-05-06 4:43 annoyingly persistant TCP connections Mike Williams
1994-05-10 22:05 ` Barry Margolin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox