[Android] Unable to query for a TXT record & [iOS] returned Port is 0
Describe the bug
After upgrading to v5.1.11 the discovery of a service on android can't obtain the TXT record anymore, whereas on iOS it works. Also the port returned is always 0.
To Reproduce
The relevenat code
_discovery = BonsoirDiscovery(type: '_sueS800Device._tcp');
await _discovery.ready;
await _discovery.start();
Expected behavior For both Android and iOS to discover the service, as well as return the correct port.
Smartphone (please complete the following information):
- Device: Samsung Galaxy S22 / iPhone SE
- OS: Android 15 / iOS 18.5
Additional context
On Android: Bonsoir DOES find the service:
D/bonsoir (18889): [discovery] [3139] Bonsoir has found a service : {"name":"stream1955plateamp-a046fca9-b469-4056-9812-c4e946d4c728","type":"_sueS800Device._tcp","port":0,"host":null,"attributes":{}}.
However, it can't obtain a TXT record
D/TXTRecord(18889): Unable to query for a TXT record. Will now retry with a different port...
D/bonsoir (18889): [discovery] [3139] Bonsoir has failed to get the TXT record of a service : {"name":"stream1955plateamp-a046fca9-b469-4056-9812-c4e946d4c728","type":"_sueS800Device._tcp","port":0,"host":null,"attributes":{}} (error %s).
On IOS:
Bonsoir DOES find the service, but PORT is 0
D/bonsoir (18889): [discovery] [3139] Bonsoir has found a service : {"name":"stream1955plateamp-a046fca9-b469-4056-9812-c4e946d4c728","type":"_sueS800Device._tcp","port":0,"host":"192.168.1.3","attributes":{}}.
It may be related to the device you're using. Do you have another Android device to try this on ?
Yes, I do. I have tried it with an older Samsung Galaxy S10. Same outcome, unfortunately...
Facing same issue (PORT is 0) on IOS After upgrading to v5.1.11
Sadly I have the same issue. I upgraded from a lower version and now this happens on the same device I tested before. A old Redmi Note 9 Pro
I have the same issue.
Have you guys tried resolving the service. i was getting the port in 0 before resolving but not after resolving it.
_discovery = BonsoirDiscovery(type: '_sueS800Device._tcp');
await _discovery.ready;
_discovery.eventStream!.listen((e) async {
if (e.type == BonsoirDiscoveryEventType.discoveryServiceFound) {
if (!e.isServiceResolved) {
print(e.service?.toJson());
e.service!.resolve(_discovery.serviceResolver);
}
}
if (e.type == BonsoirDiscoveryEventType.discoveryServiceResolved)
print((e.service as ResolvedBonsoirService).host);
});
await _discovery.start();