Closed rahulmaindargi closed 10 months ago
Hey,
This is not in the scope of the plugin. You only have to do something like :
Future<void> startDiscovery(String type, Function(BonsoirDiscoveryEvent) listener, { Duration? timeout = null }) async {
BonsoirDiscovery discovery = BonsoirDiscovery(type: type);
await discovery.ready;
discovery.eventStream!.listen(listener);
await discovery.start();
if (timeout != null) {
Timer(timeout, discovery.stop);
}
}
Is your feature request related to a problem? Please describe. When I am starting the broadcast I want it to stop broadcasting in 5 mins if no device connect to my service. When I am starting the discovery I want it to stop discovering in 5 mins if no service found.
So basically something like
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered Use Completer and timeouts somehow to call
discovery.stop()
if its not stooped already. OrBonsoirBroadcast.stop()
if still broadcasting.Additional context Add any other context or screenshots about the feature request here.