comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: gnatcol json vs network read
Date: Sat, 15 Dec 2018 01:41:56 -0800 (PST)
Date: 2018-12-15T01:41:56-08:00	[thread overview]
Message-ID: <a89a99b4-0482-450d-89c3-b73f3800dcf6@googlegroups.com> (raw)
In-Reply-To: <MHVQD.1364$YO1.266@fx31.am4>

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


      reply	other threads:[~2018-12-15  9:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 17:50 gnatcol json vs network read Stephen Leake
2018-12-14 18:53 ` Olivier Henley
2018-12-14 19:00 ` Stephen Leake
2018-12-14 21:58 ` Per Sandberg
2018-12-15  9:41   ` Stephen Leake [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox