comp.lang.ada
 help / color / mirror / Atom feed
From: "markp" <markwork66@yahoo.com>
Subject: Re: Using GNAT.Sockets
Date: 18 Apr 2005 02:01:07 -0700
Date: 2005-04-18T02:01:07-07:00	[thread overview]
Message-ID: <1113814867.251847.285880@o13g2000cwo.googlegroups.com> (raw)
In-Reply-To: <mailman.39.1113557154.24457.comp.lang.ada@ada-france.org>


Duncan Sands wrote:
> Hi markp,
>
> > Thanks for your reply. In case (1), that is what is occuring. When
I
> > call Receive_Socket again to get the rest of the data, I'm
wondering if
> > the call will place the new data at the beginning of the item
buffer.
> > That would mean I would have to copy it out before I do a
subsequent
> > read. Is this the case?
>
> Suppose your buffer is My_Buffer, and after the first call you see
> Last < My_Buffer'Last (note that if Last < My_Buffer'First then the
> connection has gone down).  Then you can do the following:
>
>    procedure Receive_Socket
>      (Socket => My_Socket,
>       Item   => My_Buffer (Last + 1 .. My_Buffer'Last),
>       Last   => Last);
>
> > I do not want a higher level routine. I would like to stay withing
the
> > GNAT.Sockets package.
>
> GNAT.Sockets provides higher level routines - the stream stuff.
>
> Ciao,
>
> Duncan.

Duncan,

Thanks for your reply. It does what I want it to do. I have one other
question. My assumption is that I have to read the data into My_buffer,
which is of a type Stream_Elemet_Array. If there a way to read the data
directly into an Ada record type, as opposed to a Stream_Element_Array?
Otherwise, I will have to read the socket and then copy the bytes into
the record type and act on it there. Is there a way to avoid this extra
copy and go directly to my data type?

Thanks once again for your help,

Mark




  reply	other threads:[~2005-04-18  9:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-13 15:07 Using GNAT.Sockets markwork66
2005-04-13 15:43 ` Duncan Sands
2005-04-15  9:04   ` markp
2005-04-15  9:25     ` Duncan Sands
2005-04-18  9:01       ` markp [this message]
2005-04-18 13:23         ` Michael Paus
2005-04-18 14:32           ` markp
2005-04-18 15:14             ` Adrien Plisson
2005-04-18 15:35               ` markp
2005-04-18 15:48                 ` Adrien Plisson
2005-04-18 17:06                   ` markp
2005-04-18 18:23                     ` markp
2005-04-18 20:45                     ` Eric Jacoboni
2005-04-18 21:30                       ` Pascal Obry
2005-04-18 23:00                         ` Eric Jacoboni
2005-04-19  7:04                           ` Pascal Obry
2005-04-19 17:36                           ` Björn Lundin
2005-04-19 19:08                             ` Eric Jacoboni
2005-04-18 13:51         ` Marc A. Criley
2005-04-14 14:45 ` Bob Spooner
2005-04-15  9:06   ` markp
2005-04-15 11:47     ` Michael Paus
2005-04-15 14:07       ` Bob Spooner
2005-04-17 15:35         ` Michael Paus
replies disabled

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