Bonjour/MYBonjourBrowser.m
changeset 50 63baa74c903f
parent 45 8efb48eabd08
child 59 46c7844cb592
     1.1 --- a/Bonjour/MYBonjourBrowser.m	Sun May 10 19:00:50 2009 -0700
     1.2 +++ b/Bonjour/MYBonjourBrowser.m	Wed Jul 01 14:14:32 2009 -0700
     1.3 @@ -51,7 +51,7 @@
     1.4  
     1.5  - (void) dealloc
     1.6  {
     1.7 -    LogTo(Bonjour,@"DEALLOC BonjourBrowser");
     1.8 +    LogTo(Bonjour,@"DEALLOC MYBonjourBrowser");
     1.9      [_myRegistration cancel];
    1.10      [_myRegistration release];
    1.11      [_serviceType release];
    1.12 @@ -160,18 +160,18 @@
    1.13  }
    1.14  
    1.15  
    1.16 -static void browseCallback (DNSServiceRef                       sdRef,
    1.17 -                            DNSServiceFlags                     flags,
    1.18 -                            uint32_t                            interfaceIndex,
    1.19 -                            DNSServiceErrorType                 errorCode,
    1.20 -                            const char                          *serviceName,
    1.21 -                            const char                          *regtype,
    1.22 -                            const char                          *replyDomain,
    1.23 -                            void                                *context)
    1.24 +static void browseCallback (DNSServiceRef        sdRef,
    1.25 +                            DNSServiceFlags      flags,
    1.26 +                            uint32_t             interfaceIndex,
    1.27 +                            DNSServiceErrorType  errorCode,
    1.28 +                            const char           *serviceName,
    1.29 +                            const char           *regtype,
    1.30 +                            const char           *replyDomain,
    1.31 +                            void                 *context)
    1.32  {
    1.33      MYBonjourBrowser *browser = context;
    1.34      @try{
    1.35 -        //LogTo(Bonjour,@"browseCallback (error=%i, name='%s')", errorCode,serviceName);
    1.36 +        LogTo(Bonjour,@"browseCallback (error=%i, name='%s', intf=%u)", errorCode,serviceName,interfaceIndex);
    1.37          if (!errorCode)
    1.38              [browser priv_gotServiceName: [NSString stringWithUTF8String: serviceName]
    1.39                                      type: [NSString stringWithUTF8String: regtype]
    1.40 @@ -253,9 +253,8 @@
    1.41          if( [[change objectForKey: NSKeyValueChangeKindKey] intValue]==NSKeyValueChangeInsertion ) {
    1.42              NSSet *newServices = [change objectForKey: NSKeyValueChangeNewKey];
    1.43              for( MYBonjourService *service in newServices ) {
    1.44 -                NSString *hostname = service.hostname;  // block till it's resolved
    1.45                  Log(@"##### %@ : at %@:%hu, TXT=%@", 
    1.46 -                      service, hostname, service.port, service.txtRecord);
    1.47 +                      service, service.hostname, service.port, service.txtRecord);
    1.48                  service.addressLookup.continuous = YES;
    1.49                  [service.addressLookup addObserver: self
    1.50                                          forKeyPath: @"addresses"