Re: read on socket shows EOF... but only when app is running in background
phn_at_icke-reklam.ipsec.nu
Date: 08/19/04
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: flex/bison vs switch"
- Previous message: Billy N. Patton: "flex/bison vs switch"
- In reply to: Ruud Schramp: "read on socket shows EOF... but only when app is running in background"
- Next in thread: Nils R. Weller: "Re: read on socket shows EOF... but only when app is running in background"
- Reply: Nils R. Weller: "Re: read on socket shows EOF... but only when app is running in background"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 19 Aug 2004 13:46:27 +0000 (UTC)
In comp.os.linux.development Ruud Schramp <r.schramp@telecom.dot.tno.dot.nl> wrote:
> Hello All,
> Does anybody know other reasons a TCP Socket will read eof besides being
> closed localy or receiving a FIN packet?
Yes.
The stack might not have all the requested number of bytes available,
giving your read(2) only the amount it has ( the rest is in
transit and will be avalable later)
Always test the number returned from read(), never assume
the chunks written is equals the chunks read.
See p9 and 77 in UNIX network programming volume 1 by R stevens,
isbn 0-13-490012-x
--
Peter Håkanson
IPSec Sverige ( At Gothenburg Riverside )
Sorry about my e-mail address, but i'm trying to keep spam out,
remove "icke-reklam" if you feel for mailing me. Thanx.
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: flex/bison vs switch"
- Previous message: Billy N. Patton: "flex/bison vs switch"
- In reply to: Ruud Schramp: "read on socket shows EOF... but only when app is running in background"
- Next in thread: Nils R. Weller: "Re: read on socket shows EOF... but only when app is running in background"
- Reply: Nils R. Weller: "Re: read on socket shows EOF... but only when app is running in background"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|