diff -r 1d6924779df7 -r 981f9d604c88 PortMapper/MYDNSService.m --- a/PortMapper/MYDNSService.m Wed Apr 29 13:29:31 2009 -0700 +++ b/PortMapper/MYDNSService.m Tue Jul 21 10:04:10 2009 -0700 @@ -143,6 +143,11 @@ } +- (BOOL) isRunning { + return _serviceRef != NULL; +} + + + (NSString*) fullNameOfService: (NSString*)serviceName ofType: (NSString*)type inDomain: (NSString*)domain @@ -291,8 +296,12 @@ NSAutoreleasePool *pool = [NSAutoreleasePool new]; LogTo(DNS,@"---serviceCallback----"); DNSServiceErrorType err = DNSServiceProcessResult(_connectionRef); - if (err) + if (err) { Warn(@"%@: DNSServiceProcessResult failed, err=%i !!!", self,err); + //FIX: Are errors here fatal, meaning I should close the connection? + // I've run into infinite loops constantly getting kDNSServiceErr_ServiceNotRunning + // or kDNSServiceErr_BadReference ... + } [pool drain]; return !err; }