[Federico asks about Unicon applications that talk TCP using a binary
protocol based on a C struct]

C struct's are not portable across different C implementations, due to
the different byte sizes of fields, differences in compiler layout of
struct elements and padding, and little-endian versus big-endianness.
So your TCP server's protocol is not portable or multiplatform unless
it formally spells out these details.

Nevertheless, of course, the question is how to process binary data from
Unicon, and the answer is: read the data as strings, a byte at a time if
you have to, and convert the binary-encoded-strings to Icon values and
stuff them into fields in a corresponding record or class.  There are IPL
procedures for doing things like converting 4 byte strings into the
corresponding Icon integer, treating the string as binary data.  But all
this will only work if you know your struct field sizes, and only run on 
machines with the same endianness, or define the endianness of the data
in the protocol and include code to convert to that endianness on machines
with the opposite polarity.


-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to