comp.lang.ada
 help / color / mirror / Atom feed
From: The Darkelf <darkelf@aim.homelinux.com>
Subject: Byte order writing to socket stream
Date: Fri, 17 May 2002 17:18:02 +0200
Date: 2002-05-17T17:18:02+02:00	[thread overview]
Message-ID: <ac36va$m6qca$1@ID-107015.news.dfncis.de> (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



             reply	other threads:[~2002-05-17 15:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-17 15:18 The Darkelf [this message]
2002-05-17 15:54 ` Byte order writing to socket stream 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
replies disabled

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