3 ms·
But if you're slamming in-memory structs over the wire, you're using packed structs. You explicitly don't want padding when you use structs that way. Whether y
by jdblair 8y ago
But if you're slamming in-memory structs over the wire, you're using packed structs. You explicitly don't want padding when you use structs that way.
Whether you should do this in 2019 is another question, but sometimes it's still the easiest way to implement a binary protocol.
- cardiffspaceman 8y agoAnd you're not writing code for big-endian machines to interoperate with little-endian machines. It's easy to write binary protocol code that way but it isn't portable.
- jdblair 8y agoIt goes without saying that you have get the endian right when you store the values. That's what the endian macros are for.