Quoted from Apple:
Terminating a Service's Registration
To terminate your service's registration, remove the socket descriptor from the run loop or the select loop and call DNSServiceRefDeallocate, passing to it the service discovery reference that was initialized when your service was registered. In addition to invalidating the service discovery reference and deallocating the memory associated with it, any resource records that have been added are de-registered and their references are invalidated. The socket that underlies the connection with the mDNSResponder daemon is closed, thereby terminating your application’s connection with the daemon.
I register a service using DNSServiceRegister, but I don't know how to unregister it. I've deallocated the reference, but it seems that the service is still there.
Don't fully understand what I need to do to "remove the socket descriptor from the run loop or the select loop"?
Thanks in advanced, Jerry