How do you trap 1/2 a tcp connection dying ?

Sean Fagan seanf at sco.COM
Thu Nov 8 16:59:56 AEST 1990


In article <12323:Nov603:18:1990 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>I think what Chris means is ``Gaaargh! Hasn't anyone told you that I/O
>system calls don't necessarily return the full amount of data you asked
>for? That you *have* to check their return values? You're probably
>checking the recv() against -1 while it's returning 0!

And, of course, when you close the connection, you have to check to make
sure that, some unknown number of hours ago, the server didn't just
disappear, or you didn't overflow your quota, or daylight savings didn't
come into action causing some packet you send a few thousand packets ago to
suddenly be invalid.

-- 
-----------------+
Sean Eric Fagan  | "*Never* knock on Death's door:  ring the bell and 
seanf at sco.COM    |   run away!  Death hates that!"
uunet!sco!seanf  |     -- Dr. Mike Stratford (Matt Frewer, "Doctor, Doctor")
(408) 458-1422   | Any opinions expressed are my own, not my employers'.



More information about the Comp.unix.questions mailing list