Add code to buffer the partial socket reads into lines