Class creating the socket connection and implementing the commands for writing and reading to the socket.