Re: Rendezvous not resolving on Panther, when compiled on Panther
Re: Rendezvous not resolving on Panther, when compiled on Panther
- Subject: Re: Rendezvous not resolving on Panther, when compiled on Panther
- From: "Phil Barrett" <email@hidden>
- Date: Mon, 3 Nov 2003 10:12:21 -0000
I've found the solution to my Rendezvous problem, which I'll pass on to help
others...
Original code:
-(void)netServiceBrowser:(NSNetServiceBrowser*)browser
didFindService:(NSNetService*)service moreComing:(BOOL)moreComing
{
NSLog(@"Found service %@\n", [service name]);
[service setDelegate:self];
[service resolve];
}
The system log showed error messages on the resolve call:
DNSServiceResolve("test", "_myservice._tcp.", "local.") failed: Client id -1
invalid (-65549)
The solution is merely to retain the service:
-(void)netServiceBrowser:(NSNetServiceBrowser*)browser
didFindService:(NSNetService*)service moreComing:(BOOL)moreComing
{
NSLog(@"Found service %@\n", [service name]);
[service retain];
[service setDelegate:self];
[service resolve];
}
The NSNetService passed to the didFindService callback has to be a
temporary, so retaining it for future use makes sense. But why it works on
Jaguar, and why the code compiled on Jaguar works on Panther, remains a
mystery.
Phil
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.