connect static method
Implementation
static Future<CastSocket> connect(String host, int port, [Duration? timeout]) async {
timeout ??= Duration(seconds: 10);
final _socket = await SecureSocket.connect(
host,
port,
onBadCertificate: (X509Certificate certificate) => true, // chromecast use self-signed certificate
timeout: timeout,
);
final socket = CastSocket._(_socket);
socket._startListening();
return socket;
}