Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!ames!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.windows.x Subject: Re: Why does X not use SO_KEEPALIVE? Message-ID: <20663@news.Think.COM> Date: 24 May 89 19:06:32 GMT References: <7992@boring.cwi.nl> <8905241247.AA00833@expire.lcs.mit.edu> Sender: news@Think.COM Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge, MA Lines: 30 In article <8905241247.AA00833@expire.lcs.mit.edu> rws@EXPO.LCS.MIT.EDU writes: >"indiscriminant" use (e.g. automatically in all X connections) is evil. Agreed. xperfmon, xclock, and other clients that produce frequent automatic output don't need keepalives, but xterm, emacs, and most other event-driven applications generally do. Servers probably don't need to use keepalives, either. > A TCP keep-alive mechanism should only be invoked in > network servers that might otherwise hang indefinitely > and consume resources unnecessarily if a client crashes > or aborts a connection during a network partition. Since only the client application knows its interaction style, only it knows whether it needs keepalives. This implies that there needs to be an option to the X stream-creation routine to specify this. If this doesn't fit into the current Xlib design, then it could be done with a new Xlib function to turn keepalives on and off. Needless to say, this option would be advisory only, since not all OSes and transport protocols may support this notion. I definitely think that this is a case where keepalives are warranted. I'm getting sick of having to hunt down all my xterms whenever my server crashes. Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar