> length prefixing is annoying when streaming
This can be avoided by magic number. If length is 0, then message length isn't known.
This can be avoided by magic number. If length is 0, then message length isn't known.
(Also, using zero as a sentinel is not necessarily a good idea, since it makes zero length messages more difficult. I'd go with -1 or ~0 instead.)
I thought -0 is only something in floating point numbers, not integers, and using floats for the length of a message sounds like a nightmare to me.