connect method

Future<bool> connect(
  1. TVDevice device, {
  2. Duration timeout = const Duration(seconds: 10),
})

Implementation

Future<bool> connect(
    TVDevice device, {
      Duration timeout = const Duration(seconds: 10),
    }) async {
  try {
    _socket = await SecureSocket.connect(
      device.ipAddress,
      device.port,
      timeout: timeout,
      // For early development; replace with proper certificate handling later
      onBadCertificate: (_) => true,
    );
    return true;
  } catch (e) {
    return false;
  }
}