Improve the tcp server and client with the option to set a terminator token. When this token is set, the server and client will automatically split all data based on the terminator char, and buffer up any dangling data that isn't terminated. This should probably much always be used (with a terminator of, i.e. "\n"), otherwise you will need to be responsible for parsing partial packets.