NSNetService does not allow

I have an existing application (actually a couple of iOS apps) that have a very basic Bonjour implementation, so the “client” can find the “server” on the network. This worked well until a recent test (I'm not quite sure if this is related to iOS8, but this is the first time I compiled these apps using iOS 8). In this case, everything works as expected until the client resolves the server address. This is always expiring at the moment. In addition, I tried several Bonjour detection applications from the application store, and they also time out (so I assume this is a problem with the server code).

In a client application, my NSNetServiceDelegate methods are called in the following order:

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

This code worked flawlessly in the past. I'm not quite sure what will cause this behavior.

Here is the code to publish 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 verified that the netServiceDidPublish: method is being called and that netServiceDidStop: is not being called.

UPDATE: I confirmed that if the service is published on an iOS 7 device, everything works as expected (even if the resolution device is on iOS 8).

UPDATE 2: I confirmed that Apple is aware of some issues with Bonjour in the iOS 8 release: https://devforums.apple.com/message/1045870#1045870

+4
source share