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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,deffccd74319c23d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail From: "markp" Newsgroups: comp.lang.ada Subject: Re: Sending Variable Length Messages with GNAT.Sockets Date: 9 May 2005 07:51:23 -0700 Organization: http://groups.google.com Message-ID: <1115650283.330746.109740@f14g2000cwb.googlegroups.com> References: <1115633512.107824.259680@g14g2000cwa.googlegroups.com> <427f3dfa$0$28058$ba620e4c@news.skynet.be> <1115637556.074009.113830@o13g2000cwo.googlegroups.com> NNTP-Posting-Host: 208.20.220.69 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1115650289 23725 127.0.0.1 (9 May 2005 14:51:29 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 9 May 2005 14:51:29 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=208.20.220.69; posting-account=_Inhcg0AAAAPC2BsuUqoGG-atarvM4_J Xref: g2news1.google.com comp.lang.ada:10978 Date: 2005-05-09T07:51:23-07:00 List-Id: Thanks John. I still have a fundamental problem. I am working on legacy code in which data is defined in records (or arrays of records) which are sent in variable lengths. We use address, byte count to send the exact number of bytes. Using Streams, it seems they type has to be of Stream_element_Array. The only way I can see to send/receive these "variable" messages is to first read our message header which contains the number of bytes in the message. Then, create a Stream_Element_Array of the exact size for the next read. Then, do an unchecked conversion or a copy bytes routine to get the data into my data type for processing. Does this sound correct? Lastly, using the 'Read function on streams, am I guaranteed to block until I receive all bytes? Thanks, Mark