[Spread-users] byte-order/endiness for payload

Joseph VanAndel vanandel at ucar.edu
Mon May 11 20:02:27 EDT 2009

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?

More information about the Spread-users mailing list