# NSNetServices documentation

Generated at 2025-09-10 09:16:48 +0000
2006 Free Software Foundation, Inc.
Software documentation for the NSNetService class
Foundation/NSNetServices.h

NSNetService lets you publish a network service in a domain using multicast DNS. Additionally, it lets you resolve a network service that was discovered by NSNetServiceBrowser. This class is an abstract superclass for concrete implementations of its functionality.

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
dataFromTXTRecordDictionary:
txtDictionary
Description forthcoming.
dictionaryFromTXTRecordData:
txtData
Description forthcoming.
TXTRecordData
Description forthcoming.
addresses
Description forthcoming.
delegate
Description forthcoming.
domain
Description forthcoming.
getInputStream:
inputStream
outputStream:
outputStream
Description forthcoming.
hostName
Description forthcoming.
initWithDomain:
domain
type:
type
name:
name
Description forthcoming.
initWithDomain:
domain
type:
type
name:
name
port:
port
Description forthcoming.
name
Description forthcoming.
port
Not implemented
protocolSpecificInformation
Description forthcoming.
publish
Description forthcoming.
publishWithOptions:
options
Not implemented
removeFromRunLoop:
aRunLoop
forMode:
mode
Description forthcoming.
resolve
Description forthcoming.
resolveWithTimeout:
timeout
Description forthcoming.
scheduleInRunLoop:
aRunLoop
forMode:
mode
Description forthcoming.
setDelegate:
delegate
Description forthcoming.
setProtocolSpecificInformation:
specificInformation
Description forthcoming.
setTXTRecordData:
recordData
Description forthcoming.
startMonitoring
Description forthcoming.
stop
Description forthcoming.
stopMonitoring
Description forthcoming.
type
Description forthcoming.
Software documentation for the NSNetServiceBrowser class
Foundation/NSNetServices.h

NSNetServiceBrowserasynchronously lets you discover network domains and, additionally, search for a type of network service. It sends its delegate a message whenever it discovers a new network service, and whenever a network service goes away.

Each NSNetServiceBrowserperforms one search at a time. So in order to perform multiple searches simultaneously, create multiple instances. This class is an abstract superclass for concrete implementations of its functionality.

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
delegate
Description forthcoming.
init
Description forthcoming.
removeFromRunLoop:
aRunLoop
forMode:
mode
Description forthcoming.
scheduleInRunLoop:
aRunLoop
forMode:
mode
Description forthcoming.
searchForAllDomains
Description forthcoming.
searchForBrowsableDomains
Description forthcoming.
searchForRegistrationDomains
Description forthcoming.
searchForServicesOfType:
serviceType
inDomain:
domainName
Description forthcoming.
setDelegate:
delegate
Description forthcoming.
stop
Description forthcoming.
Software documentation for the NSObject(NSNetServiceBrowserDelegateMethods) informal protocol
Foundation/NSNetServices.h
Description forthcoming.
netServiceBrowser:
aNetServiceBrowser
didFindDomain:
domainString
moreComing:
moreComing
Notifies the delegate that a domain was found.

See also:
[NSNetServiceBrowser -searchForBrowsableDomains]
[NSNetServiceBrowser -searchForRegistrationDomains]

netServiceBrowser:
aNetServiceBrowser
didFindService:
aNetService
moreComing:
moreComing
Notifies the delegate that a service was found.

See also:
[NSNetServiceBrowser -searchForServicesOfType:inDomain:]

netServiceBrowser:
aNetServiceBrowser
didNotSearch:
errorDict
Notifies the delegate that the search was unsuccessful.

See also:
-netServiceBrowserWillSearch:

netServiceBrowser:
aNetServiceBrowser
didRemoveDomain:
domainString
moreComing:
moreComing
Notifies the delegate that a domain has become unavailable.

See also:

netServiceBrowser:
aNetServiceBrowser
didRemoveService:
aNetService
moreComing:
moreComing
Notifies the delegate that a service has become unavailable.

See also:

netServiceBrowserDidStopSearch:
aNetServiceBrowser
Notifies the delegate that the search was stopped.

See also:
[NSNetServiceBrowser -stop]

netServiceBrowserWillSearch:
aNetServiceBrowser
Notifies the delegate that the search is about to begin.

See also:
-netServiceBrowser:didNotSearch:

Software documentation for the NSObject(NSNetServiceDelegateMethods) informal protocol
Foundation/NSNetServices.h
Description forthcoming.
netService:
sender
didAcceptConnectionWithInputStream:
inputStream
outputStream:
outputStream
Notifies the delegate that the service, which must have been published with option NSNetServiceListenForConnections, received a new connection. In order to communicate with the connecting client, you must -open the streams and schedule them with a runloop. To reject a connection, just -open and immediately -close both streams.
netService:
sender
didNotPublish:
errorDict
Notifies the delegate that the service could not get published.

See also:
[NSNetService -publish]

netService:
sender
didNotResolve:
errorDict
Notifies the delegate that the service could not get resolved.

See also:
[NSNetService -resolveWithTimeout:]

netService:
sender
didUpdateTXTRecordData:
data
Notifies the delegate that the TXT record has been updated.

See also:
[NSNetService -startMonitoring]
[NSNetService -stopMonitoring]

netServiceDidPublish:
sender
Notifies the delegate that the service was successfully published.

See also:
[NSNetService -publish]

netServiceDidResolveAddress:
sender
Notifies the delegate that the service was resolved.

See also:
[NSNetService -resolveWithTimeout:]

netServiceDidStop:
sender
Notifies the delegate that the request was stopped.

See also:
[NSNetService -stop]

netServiceWillPublish:
sender
Notifies the delegate that the network is ready to publish the service.

See also:
[NSNetService -publish]

netServiceWillResolve:
sender
Notifies the delegate that the network is ready to resolve the service.

See also:
[NSNetService -resolveWithTimeout:]

Software documentation for the NSNetServiceBrowserDelegate protocol
Foundation/NSNetServices.h

This protocol must be adopted by any class wishing to implement an NSNetServiceBrowserdelegate.

Software documentation for the NSNetServiceDelegate protocol
Foundation/NSNetServices.h
Description forthcoming.