code: synchronized void connect() {
  
          if (socket != null) {
              socket.disconnect();
          }
  
          final String token = getToken();
  
          if (!TextUtils.isEmpty(token)) {
  
              socket = factory.createSocket(token, new WeakReference<>(this));
  
              if (socket != null) {
                  socket.connect();
              }
          }
      }
docs: Start socket connection.