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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news3.google.com!news2.google.com!proxad.net!newsfeed.stueberl.de!blackbush.cw.net!cw.net!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail From: Michael Paus Newsgroups: comp.lang.ada Subject: Re: Using GNAT.Sockets Date: Fri, 15 Apr 2005 13:47:58 +0200 Organization: 1&1 Internet AG Message-ID: References: <1113404846.310840.322920@z14g2000cwz.googlegroups.com> <1113556017.302630.65980@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: p50811048.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: online.de 1113565678 12822 80.129.16.72 (15 Apr 2005 11:47:58 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Fri, 15 Apr 2005 11:47:58 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en In-Reply-To: <1113556017.302630.65980@l41g2000cwc.googlegroups.com> X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Xref: g2news1.google.com comp.lang.ada:10495 Date: 2005-04-15T13:47:58+02:00 List-Id: markp wrote: > Bob, > > Thanks for your reply. My basic quesion is I realize that a socket read > will not necessarily return all the data requested. The Receive_Socket > item input parameter takes and array. Will a subsequent read place data > at the beginning of the array, meaning I have to copy data out before I > read again? Yes it does but you do not have to copy your data. Just have a look at Duncans example. He told you already how to do it. You just have to call this in a loop until Last = My_Buffer'Last. procedure Receive_Socket (Socket => My_Socket, Item => My_Buffer (Last + 1 .. My_Buffer'Last), Last => Last); The first byte will be stored at the first position of the buffer array you provide, but in the above example we specify a sub-range of the whole buffer and so the first element of this is at the index Last + 1 of the whole buffer and this is exactly what you need. Michael