Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!uunet!zephyr.ens.tek.com!tekchips!tekgvs!sail!terryl From: terryl@sail.LABS.TEK.COM Newsgroups: comp.unix.questions Subject: Re: reading on sockets when connection breaks Message-ID: <8592@tekgvs.LABS.TEK.COM> Date: 13 Dec 90 19:28:05 GMT References: <25205@adm.brl.mil> <1990Dec6.055353.23846@Think.COM> <5727@navy40.UUCP> <1990Dec12.060545.7673@Think.COM> Sender: news@tekgvs.LABS.TEK.COM Reply-To: terryl@sail.LABS.TEK.COM Organization: Tektronix, Inc., Beaverton, OR. Lines: 25 In article <1990Dec12.060545.7673@Think.COM> barmar@think.com (Barry Margolin) writes: >In article <5727@navy40.UUCP> damenf@motcid.UUCP (Frederick Damen) writes: >>1) After reading some related information on SIGPIPE and running a test program >> it seems as though SIGPIPE is only raised on a pipe/socket that has been >> written to. > >Someone please correct me if I'm wrong (my answers are mostly educated >guesses), but I think Unix keepalives are implemented by periodically >retransmitting a packet with the sequence number of the last one sent. The >other host acknowledges having received all bytes up to that point, and >this acknowledgement serves as the indication that it is still alive. But >if you haven't yet written anything, then there is nothing to retransmit OK, consider yourself corrected!!! (-: What actually happens is that sends out a packet with a sequence number of send unacknowledged - 1, which should have been the last byte sent and already acknowledged, which is what I guess Barry was trying to say..... __________________________________________________________ Terry Laskodi "There's a permanent crease of in your right and wrong." Tektronix Sly and the Family Stone, "Stand!" __________________________________________________________