Implemented reading over TCP for client.