Added line-by-line reading from socket