Create a loop that continues to sit on a recv call. Terminate the loop only when you receive a quit call from the server. However, your code is not very logical. The usual sequence would be:
connect
LOOP:
send a message to the server
receive a response
if not "quit" THEN GOTO LOOP
close socket
terminate