Post

Replies

Boosts

Views

Activity

Reply to How to use DNSServiceReconfirmRecord?
We're using a service subtype, which is the stuff after the comma. (Our library defines the service type, but each app that uses it provides a different subtype so they don't see services published by other apps.) My co-worker found out (from Google's AI...) that in this case the fullName should be of the form <Subtype>._sub.<ServiceType>.<Transport>.<Domain> and the record should be the encoded form of <InstanceName>.<ServiceType>.<Transport>.<Domain>. I changed my code accordingly and now it works on all platforms.
Feb ’26
Reply to How to use DNSServiceReconfirmRecord?
I may have spoken too soon -- it worked for me on macOS [15.7.3] but a co-worker reports it's still returning BadReference on iOS [26?]. From my logging I can see that the arguments passed in this specific failing call are as follows: vector<uint8_t> record = encodeDNS("multipeer-todo-0F2BDA36._couchbaseP2P._tcp,com\\.couchbase\\.multipeer\\.todo.local."); err = DNSServiceReconfirmRecord( 0, // flags 15, // interface; this is what was reported by service discovery "_couchbaseP2P._tcp,com\.couchbase\\.multipeer\\.todo.local.", // fullname kDNSServiceType_PTR, kDNSServiceClass_IN, record.size(), record.data() ); where encodeDNS is a function I wrote to generate an encoded DNS record, which has unit tests to verify it correctly handles escape sequences. Note we're using a service subtype. I was worried this might require special handling, but at least on macOS it didn't. Perhaps that's different on iOS? The kDNSServiceErr_BadReference error is odd in that the function doesn't take a service reference.
Feb ’26
Reply to How to use DNSServiceReconfirmRecord?
We're using a service subtype, which is the stuff after the comma. (Our library defines the service type, but each app that uses it provides a different subtype so they don't see services published by other apps.) My co-worker found out (from Google's AI...) that in this case the fullName should be of the form <Subtype>._sub.<ServiceType>.<Transport>.<Domain> and the record should be the encoded form of <InstanceName>.<ServiceType>.<Transport>.<Domain>. I changed my code accordingly and now it works on all platforms.
Replies
Boosts
Views
Activity
Feb ’26
Reply to How to use DNSServiceReconfirmRecord?
(oops: in the fullname string above I forgot to escape the backslash before .couchbase. The actual call did have the backslash.)
Replies
Boosts
Views
Activity
Feb ’26
Reply to How to use DNSServiceReconfirmRecord?
I may have spoken too soon -- it worked for me on macOS [15.7.3] but a co-worker reports it's still returning BadReference on iOS [26?]. From my logging I can see that the arguments passed in this specific failing call are as follows: vector<uint8_t> record = encodeDNS("multipeer-todo-0F2BDA36._couchbaseP2P._tcp,com\\.couchbase\\.multipeer\\.todo.local."); err = DNSServiceReconfirmRecord( 0, // flags 15, // interface; this is what was reported by service discovery "_couchbaseP2P._tcp,com\.couchbase\\.multipeer\\.todo.local.", // fullname kDNSServiceType_PTR, kDNSServiceClass_IN, record.size(), record.data() ); where encodeDNS is a function I wrote to generate an encoded DNS record, which has unit tests to verify it correctly handles escape sequences. Note we're using a service subtype. I was worried this might require special handling, but at least on macOS it didn't. Perhaps that's different on iOS? The kDNSServiceErr_BadReference error is odd in that the function doesn't take a service reference.
Replies
Boosts
Views
Activity
Feb ’26
Reply to How to use DNSServiceReconfirmRecord?
Thanks Quinn, that worked like a charm! I suspect that this call will also inform all the other peers on the network that the service is offline, since they'll see the mDNS query and the lack of reply. True?
Replies
Boosts
Views
Activity
Jan ’26