Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualrip-off

Posted 10 November 2012 - 06:39 AM

Have you considered writing the server in Java? This might simplify some things.

As for your questions:
  • 1. What experience do you have writing portable code?
  • 2. C++ does only gives minimum data type sizes, and does not guarantee byte order. You'd have the same issue writing a portable C++ client talking to a portable C++ server. The solution here is to define what the data should look like on the wire, and then ensure that each peer will correctly pack and unpack the data from this format. You can base the wire format on one that is convenient for one of the implementations (e.g. it might map directly to a big endian C++ unpadded structure written in terms of explicitly sized types).
  • 3. Java has various Socket classes. They are essentially an object oriented version of a berkley-esque API, so will not be dissimilar to WinSock. Probably easier, if anything.
  • 4. I have no specific suggestions, but I would say that if you're experienced in network programming then you probably don't need a book. There are lots of good examples on the internet that will get you up and running quickly.

#1rip-off

Posted 10 November 2012 - 06:38 AM

Have you considered writing the server in Java? This might simplify some things.

As for your questions:
[list]
[*] 1. What experience do you have writing portable code?

[*] 2. C++ does only gives minimum data type sizes, and does not guarantee byte order. You'd have the same issue writing a portable C++ client talking to a portable C++ server. The solution here is to define what the data should look like on the wire, and then ensure that each peer will correctly pack and unpack the data from this format. You can base the wire format on one that is convenient for one of the implementations (e.g. it might map directly to a big endian C++ unpadded structure written in terms of explicitly sized types).

[*] 3. Java has various Socket classes. They are essentially an object oriented version of a berkley-esque API, so will not be dissimilar to WinSock. Probably easier, if anything.

[*] 4. I have no specific suggestions, but I would say that if you're experienced in network programming then you probably don't need a book. There are lots of good examples on the internet that will get you up and running quickly. If you

PARTNERS