I'm trying to write a simple (at least that was the idea) TCP protocol in Java.
The idea is that I must be able to transfer data from (almost?) any client type to a TCP socket wich is being listened to by a server program written in Java.
To achieve this I want to write a protocol class that makes a "handshake" first before receiving any data at all.
In that handshake I can ask for the encoding of a string, the length of an int, the clienttype, ... anything I can think of.
Reading from the socket in the server program would be done via byte primitives.
The thing I'm wondering is ... how usable is this ?
When e.g. a c/c++ client wants to write bytes (BYTE in Visual C++ ?) to a socket, how do you know they are internally presented the same way as a byte in Java (signed, 2-complement, ..) ?
I would assume slash hope that there has to be an "equivalent" for the Java byte primitive in every language.
In this case the possible client languages (at this moment) are Java, C/C++ (Visual) and VB.
It's a topic wich puzzles me a 'bit' (inside joke).
Your thoughts would be appreciated.