added connect() and made quit close the socket in client.