Make sure to initialize the socket only on connect method.