Jump to content
  • Advertisement
Sign in to follow this  
rajend3

sending binary packet vs. struct?

This topic is 4084 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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!