siggame / java-client

2 stars 0 forks source link

TCP Networking Utility #1

Open russleyshaw opened 10 years ago

russleyshaw commented 10 years ago

We need a helper function that receives something from the server. Given a address and a port, it should attempt to return the message it receives as a string (or equivalent). The networking protocol is any message prefixed by a uint32 network-byte-order length.

Basically, the function will attempt to receive 4 bytes representing the length of the message. Then the function will attempt to receive length bytes until it has received all bytes. Finally the function will return a string representing the message.

The hope is, after getting this functionality, the code will be easier to translate from C++ or Python.

russleyshaw commented 10 years ago

We also need a utility to send a message in the same format to the server.

MegaOmegaMatt commented 10 years ago

Finished it I think? Need the whole thing done to actually test if all the bytes in the right order