Sending messages through the socket