docs: private void connect() throws IOException, GeneralSecurityException {
          synchronized (closedSync) {
              if (socket == null || socket.isClosed()) {
                  SSLContext sc = SSLContext.getInstance("SSL");
                  sc.init(null, new TrustManager[] { new X509TrustAllManager() }, new SecureRandom());
                  socket = sc.getSocketFactory().createSocket();
                  socket.connect(address);
              }
              /**
               * Authenticate
               */
              CastChannel.DeviceAuthMessage authMessage = CastChannel.DeviceAuthMessage.newBuilder()
                      .setChallenge(CastChannel.AuthChallenge.newBuilder().build())
                      .build();
  
              CastChannel.CastMessage msg = CastChannel.CastMessage.newBuilder()
                      .setDestinationId(DEFAULT_RECEIVER_ID)
                      .setNamespace("urn:x-cast:com.google.cast.tp.deviceauth")
                      .setPayloadType(CastChannel.CastMessage.PayloadType.BINARY)
                      .setProtocolVersion(CastChannel.CastMessage.ProtocolVersion.CASTV2_1_0)
                      .setSourceId(name)
                      .setPayloadBinary(authMessage.toByteString())
                      .build();
  
              write(msg);
              CastChannel.CastMessage response = read();
              CastChannel.DeviceAuthMessage authResponse = CastChannel.DeviceAuthMessage.parseFrom(response.getPayloadBinary());
              if (authResponse.hasError()) {
                  throw new ChromeCastException("Authentication failed: " + authResponse.getError().getErrorType().toString());
              }
  
              /**
               * Send 'PING' message
               */
              PingThread pingThread = new PingThread();
              pingThread.run();
  
              /**
               * Send 'CONNECT' message to start session
               */
              write("urn:x-cast:com.google.cast.tp.connection", StandardMessage.connect(), DEFAULT_RECEIVER_ID);
  
              /**
               * Start ping/pong and reader thread
               */
              pingTimer = new Timer(name + " PING");
              pingTimer.schedule(pingThread, 1000, PING_PERIOD);
  
              reader = new ReadThread();
              reader.start();
  
              if (closed) {
                  closed = false;
                  notifyListenerOfConnectionEvent(true);
              }
          }
      }