setting up ways of talking to the socket