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.