Protocol: NSNetServiceDelegate

Overview

The NSNetServiceDelegate protocol defines the optional methods implemented by delegates of NSNetService objects.Notifies the delegate that a service could not be published.Informs the delegate that an error occurred during resolution of a given service.Notifies the delegate that the TXT record for a given service has been updated.Notifies the delegate that a service was successfully published.Informs the delegate that the address for a given service was resolved.Informs the delegate that a publish or resolveWithTimeout: request was stopped.Notifies the delegate that the network is ready to publish the service.Notifies the delegate that the network is ready to resolve the service.

Instance Method Summary (collapse)

Instance Method Details

- (Object) netService(sender, didNotPublish:errorDict)

Notifies the delegate that a service could not be published. This method may be called long after a netServiceWillPublish: message has been delivered to the delegate.

Parameters:

  • sender (NSNetService)

    The service that could not be published.

  • errorDict (Hash)

    A dictionary containing information about the problem. The dictionary contains the keys NSNetServicesErrorCode and NSNetServicesErrorDomain.

Returns:

- (Object) netService(sender, didNotResolve:errorDict)

Informs the delegate that an error occurred during resolution of a given service. Clients may try to resolve again upon receiving this error. For example, a DNS rotary may yield different IP addresses on different resolution requests.

Parameters:

  • sender (NSNetService)

    The service that did not resolve.

  • errorDict (Hash)

    A dictionary containing information about the problem. The dictionary contains the keys NSNetServicesErrorCode and NSNetServicesErrorDomain.

Returns:

- (Object) netService(sender, didUpdateTXTRecordData:data)

Notifies the delegate that the TXT record for a given service has been updated.

Parameters:

  • sender (NSNetService)

    The service whose TXT record was updated.

  • data (NSData)

    The new TXT record.

Returns:

- (Object) netServiceDidPublish(sender)

Notifies the delegate that a service was successfully published.

Parameters:

Returns:

- (Object) netServiceDidResolveAddress(sender)

Informs the delegate that the address for a given service was resolved. The delegate can use the addresses method to retrieve the service’s address.

Parameters:

Returns:

- (Object) netServiceDidStop(sender)

Informs the delegate that a publish or resolveWithTimeout: request was stopped.

Parameters:

Returns:

- (Object) netServiceWillPublish(sender)

Notifies the delegate that the network is ready to publish the service. Publication of the service proceeds asynchronously and may still generate a call to the delegate’s netService:didNotPublish: method if an error occurs.

Parameters:

  • sender (NSNetService)

    The service that is ready to publish.

Returns:

- (Object) netServiceWillResolve(sender)

Notifies the delegate that the network is ready to resolve the service. Resolution of the service proceeds asynchronously and may still generate a call to the delegate’s netService:didNotResolve: method if an error occurs.

Parameters:

  • sender (NSNetService)

    The service that the network is ready to resolve.

Returns: