communicate with a socket server