Switched WHILE and WITH when reading off the socket (client).