comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Gnat Sockets & Streams
Date: Sat, 15 Sep 2012 09:52:08 +0200
Date: 2012-09-15T09:52:08+02:00	[thread overview]
Message-ID: <6owmaht6knzo.brd5acsbbu7j$.dlg@40tude.net> (raw)
In-Reply-To: 201209142101005065-rblove@airmailnet

On Fri, 14 Sep 2012 21:01:00 -0500, Robert Love wrote:

> We don't see any way the
> 
>   String'Output(Channel, "Dummy Data");
> 
> can output the data one character at a time.

It could do this in any way and any combination of characters per
definition of stream. AdaCore changed the behavior of array stream
attributes, I heard. But, still, it is perfectly legal in any way.

Using streams and sockets you should remember:

1. Stream attributes are not portable. The only type you should read/write
into the socket stream is Unsigned_8 or equivalent (octet).

2. As with any I/O you should honestly implement all layers of the protocol
at hand. Don't try shortcuts like stream type attributes, representation
clauses etc.

3. Network protocols are packet-oriented. You have to use Write (of the
type Root_Stream_Type) instead of attributes to ensure that the packet is
sent as a whole. It matters for both UDP and TCP/IP.

> Is there any way a stream can be corrupted?

There is nothing corrupted in the described behavior.

> Any settings parameters I could compile with that change the behavior?

See above. 

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2012-09-21 13:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-15  2:01 Gnat Sockets & Streams Robert Love
2012-09-15  7:28 ` Simon Wright
2012-09-15 23:14   ` Simon Wright
2012-09-15  7:52 ` Dmitry A. Kazakov [this message]
2012-09-15 17:02   ` Simon Wright
2012-09-15 17:26     ` Robert Love
2012-09-15 18:17     ` Dmitry A. Kazakov
2012-09-15 19:27       ` Simon Wright
2012-09-16 13:38 ` gautier_niouzes
replies disabled

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