From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f69eb259f3ed2afb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Duncan Sands Newsgroups: comp.lang.ada Subject: Re: Using GNAT.Sockets Date: Fri, 15 Apr 2005 11:25:54 +0200 Organization: Cuivre, Argent, Or Message-ID: References: <1113404846.310840.322920@z14g2000cwz.googlegroups.com> <1113555847.303640.190000@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1113557156 63275 212.85.156.195 (15 Apr 2005 09:25:56 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Fri, 15 Apr 2005 09:25:56 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: markp Return-Path: In-Reply-To: <1113555847.303640.190000@f14g2000cwb.googlegroups.com> X-Mailer: Evolution 2.2.1.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:10489 Date: 2005-04-15T11:25:54+02:00 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.