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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:5e90:: with SMTP id h138mr5541009itb.27.1544866917433; Sat, 15 Dec 2018 01:41:57 -0800 (PST) X-Received: by 2002:aca:4eca:: with SMTP id c193mr18670oib.7.1544866917103; Sat, 15 Dec 2018 01:41:57 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!q69no151108itb.0!news-out.google.com!v71ni264ita.0!nntp.google.com!k10no150718itk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 15 Dec 2018 01:41:56 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.77.182.20; posting-account=W2gdXQoAAADxIuhBWhPFjUps3wUp4RhQ NNTP-Posting-Host: 76.77.182.20 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: gnatcol json vs network read From: Stephen Leake Injection-Date: Sat, 15 Dec 2018 09:41:57 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:55047 Date: 2018-12-15T01:41:56-08:00 List-Id: On Friday, December 14, 2018 at 1:58:05 PM UTC-8, Per Sandberg wrote: > Well this all depends on the definition of Network_String'Input and > Network_String'Output. > > Will Network_String'Output always send the whole string in such a format > that Network_String'Input is able to reconstruct it regardless of > fragmentation on the transport. Sigh, you are right. I use this for 'Input: Str : Stream_Element_Array (1 .. 8); Str_Last : Stream_Element_Offset; begin Read (Stream.all, Str, Str_Last); if Str_Last < Str'Last then raise Ada.IO_Exceptions.End_Error; end if; So 'Input either returns all the bytes sent, or raises End_Error. Thanks for the nudge :). -- Stephe