I am new to Rendezvous and am trying to whip up a demo to show
internally in my company.
I've adapted the code in mDNSPosix/Client.c to some internal code and
have it successfully printing out the services that it finds.
Currently, the code only prints out the name, service type, and domain
and tries to print out the IP and Port. The ip and port and nowhere
near the values that I registered the service with so I can only assume
I'm doing something wrong. Can you help me pinpoint that?
Thank you for your time,
_ michael
SYMPTOM
-------
A service that I registered using this commandline:
*** Found name = 'Rendezvous Test', type = '_testservice._tcp.', domain
= 'local.', IPAddress = '15.82.101.110', port = '25701'
I would have expected:
*** Found name = 'Rendezvous Test', type = '_testservice._tcp.', domain
= 'local.', IPAddress = '10.0.0.197', port = '1666'
CODE
----
void BrowseCallback(mDNS *const m, DNSQuestion *question, const
ResourceRecord *const answer, mDNSBool AddRecord)
// A callback from the core mDNS code that indicates that we've
received a
// response to our query. Note that this code runs on the main
thread
// (in fact, there is only one thread!), so we can safely printf
the results.
{
domainlabel name;
domainname type;
domainname domain;
char nameC [MAX_DOMAIN_LABEL+1]; // Unescaped name: up to 63 bytes
plus C-string terminating NULL.
char typeC [MAX_ESCAPED_DOMAIN_NAME];
char domainC[MAX_ESCAPED_DOMAIN_NAME];
const char *state;
// If the TTL has hit 0, the service is no longer available.
if (!AddRecord) {
state = "Lost ";
} else {
state = "Found";
}
fprintf(stderr, "*** %s name = '%s', type = '%s', domain = '%s',
IPAddress = '%s', port = '%d'\n",
state, nameC, typeC, domainC, buffer, answer->rdata->u.srv.port);
}
_______________________________________________
rendezvous mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/rendezvous
Do not post admin requests to the list. They will be ignored.