Jump to content
  • Advertisement
Sign in to follow this  
rajend3

sending binary packet vs. struct?

This topic is 3990 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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.

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!