On Sep 15, 7:29 pm, "Bo Persson" <b...@gmb.dk> wrote:
Goran Pusic wrote:
[...]
You define your serialized/streamed/marshaled format in a
toolchain- agnostic manner. Specifically for numbers, you need to
know the endiannes, too. That influences they way you
(de)serialize them on the sending/receiving sides.
Right, you define the transport format for the network, and
implement that on each platform. VERY hard to do that portably.
Not that hard. Floating point can be tricky, but the rest is
generally pretty straightforward (and the C library has
functions which simplify the floating point as well, provided
you use a binary format in the transport).
And of course, there is a question of how portable you really
have to be. For a lot of people, 2's complement and IEEE
floating point are acceptable restrictions (even though they
exclude most, if not all, mainframes).
Ok, less hard if you can live without some of harder parts. :-)