So Andy Ross says:
> John Wojnaroski wrote:
>  > Bottom line: trying to run fgfs and opengc across the network with
>  > different platforms (in this case linux and cygwin) results in each
>  > side having a different value for the class in raw_ctrls.hxx and
>  > the socket read operations fail.
>  >
>  > I think the problem is especially troublesome when ints, bools, and
>  > floats are inside variables bounded by double types. It looks like
>  > it really gets messy trying to line up the various types so both
>  > sides see the same data boundaries.
> 
> What you're trying to do won't work.  It might work, if the
> architectures and compilers on both sides of the wire happen to agree.
> But in the general case, it just won't work.  Even if the sizes and
> layouts happen to agree, the byte ordering might not.  You can't do
> network I/O by dumping memory to a socket; it won't work. :)
> 
> Write up a wire protocol specification as your basis, and implement
> that portably.  It's really your only choice.  And it's not very hard,
> just a little tedious.

XDR is a well-established protocol that does just that:

http://stommel.tamu.edu/~baum/programming.html#XDR

If you're on a UNIX box you should also be able to do "man rpcgen".

Don't let the references to RPC (Remote Procedure Calls) confuse you,
XDR was created to support RPC but can also be used stand-alone.

Groeten,                                - Jacco

--
Think about it:               | In Real Life: Jacco van Schaik
If the wheel had never been   | Mail me at:   [EMAIL PROTECTED]
reinvented, we'd still be     | Spam bait:    postmaster@localhost
driving on logs...            | See also http://www.frontier.nl/



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to