Added function to get single lines, handle ping/pong.