4

I have an existing application (actually a pair of iOS applications) which have a very basic Bonjour implementation so the 'client' can find the 'server' on the network. This worked fine until a recent test (I'm not completely for sure that this is related to iOS8, but this is the first time I've compiled these apps with iOS 8). In this case, all works as expected until the client goes to resolve the address of the server. At this point, it always times out. Also, I've tried a few Bonjour discovery apps from the app store and they timeout also (so I'm assuming this is a problem with the server code).

In the client application my NSNetServiceDelegate methods are called in this order:

netServiceWillResolve:
(then it waits the full timeout period that I specified in resolveWithTimeout:)
netService:didNotResolve:

This code has worked flawlessly in the past. I'm not entirely sure what would cause this behavior.

Here is the code for publishing the service:

- (void)initializeServerServiceStatus
{
    NSString *deviceName = [[UIDevice currentDevice] name];
    NSString *serviceName = [NSString stringWithFormat:@"iPad Server - %@", deviceName];

    self.serverPresentationService = [[NSNetService alloc] initWithDomain:@"local."
                                                                     type:SERVICE_NAME_IPAD_SERVER
                                                                     name:serviceName
                                                                     port:self.port];

    self.serverPresentationService.delegate = self;
    [self.serverPresentationService publish];
    self.isPublishing = YES;
}

I have verified that the netServiceDidPublish: method is called and that the netServiceDidStop: is not called.

UPDATE: I have verified that if the service is published on an iOS 7 device, all works as expected (even if the resolving device is on iOS 8).

UPDATE 2: I have verified that Apple knows of some problems with Bonjour in the iOS 8 release: https://devforums.apple.com/message/1045870#1045870

dtuckernet
  • 7,817
  • 5
  • 39
  • 54

0 Answers0