The new protocol is all transaction take place in the following way: First the total size (in bytes) of the response is sent, and then those bytes. The client reads the total number of bytes from the socket. I need to implement the get and put commands, but it will be pretty much the same concept.