what about little-endians?

Camilo Cerchiari <>
Fri Mar 12 20:03:03 CET 2010


hello all,

i'm working on a system that receives socket messages with a 4 bytes header
containing an unsigned integer representing the size in bytes of the rest of
the message.

everything would be just fine if the header was in big-endian byte order, as
i could set inet:setopts(Socket, [{active,true},{packet,4}]) and receive the
socket packets as erlang messages.

unfortunately the header is in little-endian byte order. so...  why only
big-endian is available for inet:setops?  are there any plans for including
support for little-endians like my clients?  if no plans...  i would like to
add that -1, -2, -4 packet options in the code myself.  could you give me
some tips to get started with that?  in a first quick search i didn't get to
the part of the code that controls that.

thanks in advance,
salutes,
Camilo


More information about the erlang-questions mailing list