comp.lang.ada
 help / color / mirror / Atom feed
* Byte order writing to socket stream
@ 2002-05-17 15:18 The Darkelf
  2002-05-17 15:54 ` Robert L. Klungle
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: The Darkelf @ 2002-05-17 15:18 UTC (permalink / raw)


Hi, I have an Ada program with GNAT.Sockets that works fine when client
and server are in the same architecture. The problem is when client runs
on HP and the server on Intel, or viceversa.

It raises a STORAGE_ERROR exception, when it reads an array from the
socket stream. I guess the problem must be the byte order, so one solution
should be to write the size of the array(integer) and then the elements of
the array (strings), checking the integer byte order.

Can the conversion to the net standard be done "on the fly", as I do the
Stream'Output(stream,theArray), or it's necesary to manually output each
element?

If so, any suggestion for checking the architecture byte order and
ouputing it in some standard way?

May it be easier or better to just output the integer values as strings
(Integer'Image) ?

Thanks for your opinions and suggestions.

Alvaro J. Iradier Muro



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-05-18 20:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-17 15:18 Byte order writing to socket stream The Darkelf
2002-05-17 15:54 ` Robert L. Klungle
2002-05-17 16:10 ` David C. Hoos
2002-05-17 21:11 ` Ted Dennison
2002-05-18  6:47   ` Simon Wright
2002-05-18  8:09     ` David C. Hoos, Sr.
2002-05-18 17:09       ` Simon Wright
2002-05-18  8:11 ` Dr. Michael Paus
2002-05-18 20:30   ` Robert Dewar

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