comp.lang.ada
 help / color / mirror / Atom feed
From: "fabio de francesco" <fmdf@tiscali.it>
Subject: Re: "broken pipe" while reading/writing stream-based sockets
Date: 20 May 2005 08:01:28 -0700
Date: 2005-05-20T08:01:28-07:00	[thread overview]
Message-ID: <1116601288.424625.176760@g14g2000cwa.googlegroups.com> (raw)
In-Reply-To: <87zmuxqz0r.fsf@deneb.enyo.de>


Florian Weimer wrote:
> * fabio de francesco:
>
> > 1) Why does this server sometimes crash with "Broken Pipe"?
>
> This usually indicates that the client closed its end of the
> connection while the server was still sending data.  Maybe this
> happens because your code does not deal with partial reads/writes.
>
> > 2) It seems that using Input/Output instead of Read/Write never
causes
> > "Broken Pipe". Why?
>
> The stream implementation provided by GNAT.Sockets deals with partial
> reads and writes.

In C I know how to read() in a loop and increment a pointer to a buffer
(a C string) while receiving characters until there are no more of
them. It is sufficient that read() returns how many characters has
already read and some little math involving buffer size.

In Ada I don't know how to do it... Can you please give me any
suggestions?

Thank you in advance.

fabio




  reply	other threads:[~2005-05-20 15:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-10 23:02 "broken pipe" while reading/writing stream-based sockets fabio de francesco
2005-05-11 10:46 ` Adrien Plisson
2005-05-11 15:01   ` fabio de francesco
2005-05-11 21:18 ` Simon Wright
2005-05-11 23:30   ` fabio de francesco
2005-05-13 20:18   ` fabio de francesco
2005-05-13 20:25     ` fabio de francesco
2005-05-14 20:39     ` Jeffrey Carter
2005-05-14 21:27 ` Florian Weimer
2005-05-20 15:01   ` fabio de francesco [this message]
2005-05-20 17:52     ` tmoran
2005-05-20 20:02     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox