Rendezvous not resolving on Panther, when compiled on Panther
Rendezvous not resolving on Panther, when compiled on Panther
- Subject: Rendezvous not resolving on Panther, when compiled on Panther
- From: "Phil Barrett" <email@hidden>
- Date: Fri, 31 Oct 2003 09:24:16 -0000
My Rendezvous code works on Jaguar but not Panther.
Test code is below. Compile and run:
% gcc rentest.m -o rentest -f Foundation
% ./rentest
Then (or indeed earlier) use mDNS (in /usr/bin on Panther; use Panther
version or compile Rendezvous sample code on Jaguar) to advertise a service:
% mDNS -R Test _myservice._tcp. local. 2000
Registering Service Test._myservice._tcp.local. port 2000
Talking to DNS SD Daemon at Mach port 3331
Got a reply from the server: Name now registerd and active
On Jaguar rentest correctly outputs:
2003-10-31 08:56:00.205 rentest[511] Found service Test
2003-10-31 08:56:00.255 rentest[511] Resolved service Test
But on Panther I just get:
2003-10-31 08:45:12.135 rentest[1423] Found service Test
The service is discovered, but it never resolves.
It gets more suspicious ... if I compile rentest on Jaguar, it works on
Jaguar and Panther. When I compile on Panther (with any of the three
flavours of gcc) it doesn't work on Panther, but it does (at least with gcc
2.95; I got tired of rebooting) work on Jaguar.
Any ideas?
Phil
rentest.m follows:
#import <Foundation/Foundation.h>
@interface MyDelegate : NSObject
@end
@implementation MyDelegate
-(void)netServiceBrowser:(NSNetServiceBrowser*)browser
didFindService:(NSNetService*)service moreComing:(BOOL)moreComing
{
NSLog(@"Found service %@\n", [service name]);
[service setDelegate:self];
[service resolve];
}
-(void)netServiceBrowser:(NSNetServiceBrowser*)browser
didRemoveService:(NSNetService*)service moreComing:(BOOL)moreComing
{
NSLog(@"Removed service %@\n", [service name]);
}
- (void)netService:(NSNetService *)service didNotResolve:(NSDictionary
*)errorDict
{
NSLog(@"Failed to resolve service %@\n", [service name]);
}
-(void)netServiceDidResolveAddress:(NSNetService*)service
{
NSLog(@"Resolved service %@\n", [service name]);
}
@end
int main(int argc, char**argv)
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSNetServiceBrowser * browser = [[[NSNetServiceBrowser alloc] init]
retain];
[browser setDelegate:[[MyDelegate alloc] init]];
[browser searchForServicesOfType:@"_myservice._tcp." inDomain:@""];
[[NSRunLoop currentRunLoop] run];
return 0;
}
_______________________________________________
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.