[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network number scheme/Dead list?



This used to be the case but not anymore. Our main product here uses
rpc and shares data across platforms extensivly and all was fine until
the new generation machines arrived (Dec Alpha particularly). Our main
problem was if you use long ints (which normally used to be 32bits)
everything goes haywire, since the Alpha uses 64bit long ints.  Ok we
could have programed around this without xdr, but if you wan't to be
sure data is correctly passed between current machines _and_ any future
machines I think you really should convert to xdr format and then
convert back at the other end.

Dave Halliday

>But... If all you're doing is sending integers back and forth, you don't need
>it. Just use htonl/ntohl and htons/ntohs for formatting longs and shorts. On
>a big-endian machine these are no-op macros, on a little-endian machine they'll
>swap the byte order around. Also if you're sending floating point numbers
>back and forth, I would still avoid XDR if you know that all your target
>systems use IEEE format. Just about everything in the world does...
>