[Spread-users] byte-order/endiness for payload
Alec H. Peterson
alec.peterson at messagesystems.com
Mon May 11 20:07:57 EDT 2009
Hi Joseph,
On May 11, 2009, at 17:02, Joseph VanAndel wrote:
> What techniques do spread users use to handle byte-order and alignment
> issues for messages sent via spread?
>
> For example, if I'm sending a set of parameters
>
> struct example {
> int param1;
> int param2;
> float f1;
> float f2;
> };
> from one computer to another computer with different byte order and/or
> alignment, I can't simply send the byte representation of the
> structure.
>
> For integers, I could use the htohl() calls, but there is no standard
> implementation (that I know of) for network byte order for floats or
> doubles. I could also use Sun's xdr or send the parameters using XML.
>
> Any other suggestions?
If you aren't worried about wasting a bit of space you can just put
them in as string buffers.
Alec
--
Alec H. Peterson - alec.peterson at messagesystems.com
+1 443 656 3322
Director of Technical Services
Message Systems, Inc.
More information about the Spread-users
mailing list