discovery method

  1. @override
Future<List> discovery(
  1. String type,
  2. int timeout
)
override

Implementation

@override
Future<List> discovery(String type, int timeout) async {
  try {
    return await discoveryLoop(type, timeout).timeout(
      Duration(seconds: timeout), // กำหนด Timeout 5 นาที
      onTimeout: () {
        throw TimeoutException("Method timed out after 5 minutes.");
      },
    );
  } on TimeoutException catch (e) {
    return [];
  } catch (e) {
    return [];
  }
}