[openamq-dev] help on sending vector via middleware

Martin Sustrik sustrik at imatix.com
Fri Aug 17 12:36:51 CEST 2007


> 1. Would the strings be zero-terminated or length-prefixed? If binary
> zero may occur in the middle of the string, legth-prefixing is the only
> option.
> 
>   It binary

Let me explain. Zero terminated encoding of string "ABC" would look like 
this (hexa): "41424300". Length prefixed would look like this (hexa): 
"03414243". With zero terminated encoding your string cannot contain 
binary zeroes, otherwise it won't be distinguishable whether binary zero 
on the wire is just a character in the string or whether it is string 
terminator. With length-prefixed encoding you have to decide whether the 
length will be encoded as 1-byte integer, 2-byte integer etc. With 
1-byte integer you can encode strings up to 255 bytes, with 2-byte 
integer string up to 65535 characters etc.

> 3. Do you want integers in big- or little- endian representation on the
> wire?
> 
> im working on the Intel platform so it will be little endian

Ok, but you have to keep in mind that once big-endian platform is 
connected you would have to reverse the byte order when working with 
integers.

> 5. What binary encoding of floating point numbers would you choose?
> (There is a RFC for that, you may want to check it out, however, I've
> forgot the number...)
> 
> and no floats also

Hm, there's double in your struct. That's floating point datatype.

Martin


More information about the openamq-dev mailing list