Creates an instance of a Network Service object.
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+
- tvOS 9.0+
The allocator to use to allocate memory for the new object. Pass
kto use the current default allocator.
The type of service being registered; cannot be
NULL. For a list of valid service types, see http://www.iana.org/assignments/port-numbers.
A unique name if the instance will be used to register a service. The name will become part of the instance name in the DNS records that will be created when the service is registered. If the instance will be used to resolve a service, the name should be the name of the machine or service that will be resolved.
Local IP port, in host byte order, on which this service accepts connections. Pass zero to get placeholder service. With a placeholder service, the service will not be discovered by browsing, but a name conflict will occur if another client tries to register the same name. Most applications do not need to use placeholder service.
A new net service object, or
NULL if the instance could not be created. Ownership follows the The Create Rule.
If the service depends on information in DNS TXT records, call CFNetServiceSetProtocolSpecificInformation.
If the CFNetService is to run in asynchronous mode, call
CFNet to prepare the service for running in asynchronous mode. Then call
CFNet to schedule the service on a run loop. Then call
CFNet to make the service available.
If the CFNetService is to run in synchronous mode, call
To terminate a service that is running in synchronous mode, call
This function is thread safe.