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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b283baa6a69c5e41,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-17 08:18:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!73155-cm.able.ES!not-for-mail From: The Darkelf Newsgroups: comp.lang.ada Subject: Byte order writing to socket stream Date: Fri, 17 May 2002 17:18:02 +0200 Message-ID: NNTP-Posting-Host: 73155-cm.able.es (212.97.173.155) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1021648683 23292298 212.97.173.155 (16 [107015]) X-Orig-Path: not-for-mail User-Agent: Pan/0.11.3 (Unix) X-Comment-To: ALL Xref: archiver1.google.com comp.lang.ada:24276 Date: 2002-05-17T17:18:02+02:00 List-Id: 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