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