sending binary packet vs. struct?
You only use structs for IPC on the same machine, when communicating within a codebase compiled on the same compiler using same libraries.
Another possible use for structs would be within very controlled and absolutely performance critical systems, where you have full control over all hardware and OS used.
When sending over the network, you always explicitly serialize. Always. Or you're building a time bomb.
Another possible use for structs would be within very controlled and absolutely performance critical systems, where you have full control over all hardware and OS used.
When sending over the network, you always explicitly serialize. Always. Or you're building a time bomb.
If you a compiled and same OS & hardware .. no problem.
In another ways you will get problem:
1) struct aligment -> size my be not equals
2) byte ordered for data ( same binnary data on Intel and PowerPC not be equals)
In another ways you will get problem:
1) struct aligment -> size my be not equals
2) byte ordered for data ( same binnary data on Intel and PowerPC not be equals)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement