Sign in to follow this  
Etherstar

Cross language / cross platform questions.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this