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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.belwue.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Howto read line from a stream Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <83317a97-dae5-4c84-a1ac-88a87833cf3f@q14g2000vbn.googlegroups.com> <03bab021-0df6-445b-b2f7-7a3ab770448c@b1g2000vbc.googlegroups.com> Date: Sun, 31 May 2009 18:07:12 +0200 Message-ID: NNTP-Posting-Date: 31 May 2009 18:07:14 CEST NNTP-Posting-Host: 29000b77.newsspool1.arcor-online.net X-Trace: DXC=0kN56>:QLH[AX0F2i>KEJLQ]Q1S0CT On Sun, 31 May 2009 08:38:57 -0700 (PDT), sjw wrote: > On May 31, 12:34�pm, "Dmitry A. Kazakov" > wrote: > >> One potential problem with using Streams as an interface to sockets is that >> there is nothing in the Ada standard that mandates Stream_Element to be an >> octet of bits, as socket I/O demands. > > Can't imagine what reason an implementer would have to make a stream > element anything other than an octet! (for any general-purpose > processor you'd actually be likely to come across). This is a question you should better address to the designers of the Ada standard. For some reasons they didn't take the responsibility to mandate that Stream_Element'Size = 8. I am not a language lawyer, but I remember a DSP processor with sizeof(char)=4. I suggest that it should be difficult quite there to have: type Stream_Element_Array is array(Stream_Element_Offset range <>) of aliased Stream_Element; (note *aliased*), with 8 bit Stream_Element and packed Stream_Element_Array. Honestly, I have no idea how socket library should function there (I don;t remember if it had any). Probably it extended and truncated each octet. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de