MBS Bonjour - Setting and getting TXT record

Hi,

I’m trying to use Bonjour to register a service and to pass some extra informations in the TXT record.

How to I set this TXT record ?
Is there specific formats or restrictions ?

Then, when the TXT record is set, how do I get it back using browse of lookup?

I tried by modifying the “Bonjour” example in MBS Network:

  • specifying the TXT record in DNSServiceRegisterMBS.Register but the registration failed.
  • registering the service with an empty TXT record then adding it using .AddRecord(r.kTypeTXT, “my text here”,0) or .UpdateRecord(“my text here”,0) this doesn’t fail but when resolving (ServiceResolve event of DNSServiceResolveMBS) the service TXT record is empty.

It’s probably not relevant but I’m testing on macOS Monterey, Xojo 2021r3.1, MBS plugins v231.

Thanks for any hints !

Regards,

Olivier

I found information in Google with:

Bonjour and “TXT record”

Do you use dataFromTXTRecordDictionary method in NSNetServiceMBS class to build the text record? While it says text, it may be a specific format.

Thanks, I did too. But it doesn’t help using TXT records with DNSServiceRegisterMBS so far …

No, I was using DNSServiceRegisterMBS.
I’ll try using NSNetServiceMBS instead.
Thanks

Hi @Christian_Schmitz,
I’m able to se and get the TXT record data using NSNetServiceMBS.
Thanks !
Olivier

1 Like