Open kostadin24 opened 1 year ago
Do you have some more logs? Any code for reproducing the error?
Future<List
DeviceDiscoverer discoverer = DeviceDiscoverer();
final Duration duration = Duration(seconds: secondsDuration);
await discoverer.start(ipv4: true, ipv6: false);
List<SSDPService> services = [];
discoverer.quickDiscoverClients().listen((client) async {
try {
final dev = await client.getDevice();
if (dev != null) {
var metadata = _parseMetadata(dev);
services.add(SSDPService(dev.friendlyName ?? '', dev.deviceType ?? '', dev.url ?? '', metadata, 'SSDP', dev.manufacturer, dev.modelName));
}
} catch (e) {
print('[SSDPServiceDiscoverer] ERROR: $e - ${client.location} ');
}
});
await Future.delayed(duration);
discoverer.stop();
if (_loggingEnabled)
print('### ${DateTime.now()} End SSDP scan');
return services;
}
Strange moment is that if I replace:
discoverer.quickDiscoverClients().listen((client) async {
with
List<DiscoveredClient> clients = await discoverer.quickDiscoverClients().toList();
no more timeouts printed in logs.
Like Flutter can not handle too many async calls in parallel. Waiting to get list and then to call getDevice is longer, but in my case fixes the issue.
That seems odd, but configurable timeouts still seem like a good enhancement.
Hello From time to time I see timeouts:
TimeoutException after 0:00:10.000000: Future not completed - http://192.168.1.104/2_v4_upnp_device_desc.xml TimeoutException after 0:00:10.000000: Future not completed - http://192.168.1.113:6661/ TimeoutException after 0:00:10.000000: Future not completed - http://192.168.1.1:49152/IGDdevicedesc.xml TimeoutException after 0:00:10.000000: Future not completed - http://192.168.1.1:49154/description.xml
It happens on random manner. Sometimes I see them, sometime not. I saw timeout values in library, but can not find way to configure them. Most frequently I see this for router. Like too much services to process. Can we configure timeouts?