comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: "broken pipe" while reading/writing stream-based sockets
Date: Fri, 20 May 2005 12:52:22 -0500
Date: 2005-05-20T12:52:22-05:00	[thread overview]
Message-ID: <ZKadnUYbr6tLvhPfRVn-gA@comcast.com> (raw)
In-Reply-To: 1116601288.424625.176760@g14g2000cwa.googlegroups.com

> 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?
   Buffer : String(a .. b);
   Last : Natural := Buffer'first-1;
begin
   while Last < Buffer'last loop
     read(input_source, Buffer(Last+1 .. Buffer'last), Last);
   end loop;



  reply	other threads:[~2005-05-20 17:52 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
2005-05-20 17:52     ` tmoran [this message]
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