This code executes until the user inputs a "quit" message. Furthermore, the code does not stop until the server replies with some data.