socket version of the server and client