Jump to content
  • Advertisement
Sign in to follow this  
Etherstar

Cross language / cross platform questions.

This topic is 4621 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

I have a couple questions regarding languages and platforms for a networking application that I would like to make. Let it also be known I know next to nothing about networking in programming. Basically what I would ideally like to do is create a game where the client program is written in C# and the host program is written in a different and cross platform language, such as Java or C++. This so I could run the server on a wide variety of platforms, yet keep the client purely windows based for now. Here are my questions: 1) Is this possible? 2) If possible where can I find information on this? 3) Is it not worth the aggrivation of trying to make a cross platform/cross language server app for a purely window based client?

Share this post


Link to post
Share on other sites
Advertisement
1) Yes.
2) Read the documentation for the networking APIs you choose to use. Basically you need to develop a protocol that your application uses and then read and write to that protocol on both ends of the program. You can use binary or string based protocols. Just choose something and then try to get both ends to produce the same network traffic.
3) You'll find that most of what you need to do will be pretty similar no matter which platform or language you are using.

Share this post


Link to post
Share on other sites
Don't forget to use network-order (little endian) for your numeric types.
If both platforms are x86 it's just 'good practice' to do this, but some platforms use little endian. look up htons() htonl() etc. etc.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by _winterdyne_
Don't forget to use network-order (little endian) for your numeric types.
If both platforms are x86 it's just 'good practice' to do this, but some platforms use little endian. look up htons() htonl() etc. etc.


The network byte order is big endian, and x86 platform uses little endian.

If the protocol specifies the byte order of each data type used, then any system can read it byte by byte and reconstruct the data from that. You can even mix various endiannesses and word widths, just write a protocol encoder/decoder to handle the data correctly.

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!