CFNetServiceSetClient(_:_:_:)
Associates a callback function with a CFNetService or disassociates a callback function from a CFNetService.
Declaration
func CFNetServiceSetClient(_ theService: CFNetService, _ clientCB: CFNetServiceClientCallBack?, _ clientContext: UnsafeMutablePointer<CFNetServiceClientContext>?) -> BoolParameters
- theService:
The CFNetService; cannot be
NULL. - clientCB:
The callback function that is to be associated with this CFNetService. If you are shutting down the service, set
clientCBtoNULLto disassociate from this CFNetService the callback function that was previously associated. - clientContext:
Context information to be used when
clientCBis called; cannot beNULL.
Return Value
TRUE if the client was set; otherwise, FALSE.
Discussion
The callback function specified by clientCB will be called to report IP addresses (in the case of CFNetServiceResolve) or to report registration errors (in the case of CFNetServiceRegister).
Special Considerations
This function is thread safe.
For a CFNetService that will operate asynchronously, call this function and then call CFNetServiceScheduleWithRunLoop(_:_:_:) to schedule the service on a run loop. Then call CFNetServiceRegister or CFNetServiceResolve.
See Also
Network Services
CFNetServiceCFNetServiceBrowserCFNetServiceBrowserFlagsCFNetServiceMonitorCFNetServiceMonitorTypeCFNetServiceClientContextCFNetServiceRegisterFlagsCFNetServicesErrorCFNetServiceBrowserInvalidate(_:)CFNetServiceBrowserScheduleWithRunLoop(_:_:_:)CFNetServiceBrowserCreate(_:_:_:)CFNetServiceBrowserGetTypeID()CFNetServiceBrowserSearchForDomains(_:_:_:)CFNetServiceBrowserSearchForServices(_:_:_:_:)CFNetServiceBrowserStopSearch(_:_:)