Bonsoir icon indicating copy to clipboard operation
Bonsoir copied to clipboard

[Android] Unable to query for a TXT record & [iOS] returned Port is 0

Open icatcher-at opened this issue 5 months ago • 5 comments

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":{}}.

icatcher-at avatar Jul 17 '25 18:07 icatcher-at

It may be related to the device you're using. Do you have another Android device to try this on ?

Skyost avatar Jul 19 '25 15:07 Skyost

Yes, I do. I have tried it with an older Samsung Galaxy S10. Same outcome, unfortunately...

icatcher-at avatar Jul 21 '25 09:07 icatcher-at

Facing same issue (PORT is 0) on IOS After upgrading to v5.1.11

Gajendra-Shegunashi avatar Jul 31 '25 13:07 Gajendra-Shegunashi

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

ptrckdev avatar Aug 11 '25 15:08 ptrckdev

I have the same issue.

Charyun avatar Oct 01 '25 08:10 Charyun

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();

juampiq6 avatar Dec 20 '25 15:12 juampiq6