Up

NSNetServices documentation

Authors

Generated by richard

Contents -

  1. NSNetService class description
  2. NSNetServiceBrowser class description
  3. NSObject (NSNetServiceBrowserDelegateMethods) class description
  4. NSObject (NSNetServiceDelegateMethods) class description

NSNetService class description

NSNetService : NSObject

Declared in:
Foundation/NSNetServices.h
Availability: OpenStep

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 .

Method summary

dataFromTXTRecordDictionary: 

+ (NSData*) dataFromTXTRecordDictionary: (NSDictionary*)txtDictionary;
Availability: OpenStep

Converts txtDictionary into a TXT data.

dictionaryFromTXTRecordData: 

+ (NSDictionary*) dictionaryFromTXTRecordData: (NSData*)txtData;
Availability: OpenStep

Converts the TXT data txtData into a dictionary.

TXTRecordData 

- (NSData*) TXTRecordData;
Availability: OpenStep

Returns the TXT record.

addresses 

- (NSArray*) addresses;
Availability: OpenStep

Returns an array of NSData objects that each contain the socket address of the service.

delegate 

- (id) delegate;
Availability: OpenStep

Returns the receiver's delegate.

domain 

- (NSString*) domain;
Availability: OpenStep

Returns the domain name of the service.

getInputStream: outputStream: 

- (BOOL) getInputStream: (NSInputStream**)inputStream outputStream: (NSOutputStream**)outputStream;
Availability: OpenStep

Retrieves the input and output stream for the receiver.

hostName 

- (NSString*) hostName;
Availability: OpenStep

Returns the host name of the computer publishing the service.

initWithDomain: type: name: 

- (id) initWithDomain: (NSString*)domain type: (NSString*)type name: (NSString*)name;
Availability: OpenStep

Initializes the receiver for service resolution. Use this method to create an object if you intend to -resolve a service.

initWithDomain: type: name: port: 

- (id) initWithDomain: (NSString*)domain type: (NSString*)type name: (NSString*)name port: (int)port;
Availability: OpenStep

This is a designated initialiser for the class.
Initializes the receiver for service publication. Use this method to create an object if you intend to -publish a service.

name 

- (NSString*) name;
Availability: OpenStep

Returns the name of the service.

port 

- (NSInteger) port;
Availability: MacOS-X 10.5.0

Not implemented

protocolSpecificInformation 

- (NSString*) protocolSpecificInformation;
Availability: OpenStep

This method is deprecated. Use -TXTRecordData instead.

publish 

- (void) publish;
Availability: OpenStep

Attempts to publish a service on the network.

publishWithOptions: 

- (void) publishWithOptions: (NSNetServiceOptions)options;
Availability: MacOS-X 10.5.0

Not implemented

removeFromRunLoop: forMode: 

- (void) removeFromRunLoop: (NSRunLoop*)aRunLoop forMode: (NSString*)mode;
Availability: OpenStep

Removes the service from the specified run loop.

resolve 

- (void) resolve;
Availability: OpenStep

This method is deprecated. Use -resolveWithTimeout: instead.

resolveWithTimeout: 

- (void) resolveWithTimeout: (NSTimeInterval)timeout;
Availability: OpenStep

Starts a service resolution for a limited duration.

scheduleInRunLoop: forMode: 

- (void) scheduleInRunLoop: (NSRunLoop*)aRunLoop forMode: (NSString*)mode;
Availability: OpenStep

Adds the service to the specified run loop.

setDelegate: 

- (void) setDelegate: (id)delegate;
Availability: OpenStep

Sets the receiver's delegate.

setProtocolSpecificInformation: 

- (void) setProtocolSpecificInformation: (NSString*)specificInformation;
Availability: OpenStep

This method is deprecated. Use -setTXTRecordData: instead.

setTXTRecordData: 

- (BOOL) setTXTRecordData: (NSData*)recordData;
Availability: OpenStep

Sets the TXT record.

startMonitoring 

- (void) startMonitoring;
Availability: OpenStep

Starts monitoring of TXT record updates.

stop 

- (void) stop;
Availability: OpenStep

Stops the current attempt to publish or resolve a service.

stopMonitoring 

- (void) stopMonitoring;
Availability: OpenStep

Stops monitoring of TXT record updates.

type 

- (NSString*) type;
Availability: OpenStep

Returns the type of the service.

NSNetServiceBrowser class description

NSNetServiceBrowser : NSObject

Declared in:
Foundation/NSNetServices.h
Availability: OpenStep

NSNetServiceBrowser asynchronously 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 NSNetServiceBrowser performs one search at a time. So in order to perform multiple searches simultaneously, create multiple instances.

Method summary

delegate 

- (id) delegate;
Availability: OpenStep

Returns the receiver's delegate.

init 

- (id) init;
Availability: OpenStep

This is a designated initialiser for the class.
Initializes the receiver.

removeFromRunLoop: forMode: 

- (void) removeFromRunLoop: (NSRunLoop*)aRunLoop forMode: (NSString*)mode;
Availability: OpenStep

Removes the receiver from the specified runloop.

scheduleInRunLoop: forMode: 

- (void) scheduleInRunLoop: (NSRunLoop*)aRunLoop forMode: (NSString*)mode;
Availability: OpenStep

Adds the receiver to the specified runloop.

searchForAllDomains 

- (void) searchForAllDomains;
Availability: OpenStep

Search for all visible domains. This method is deprecated.

searchForBrowsableDomains 

- (void) searchForBrowsableDomains;
Availability: OpenStep

Search for all browsable domains.

searchForRegistrationDomains 

- (void) searchForRegistrationDomains;
Availability: OpenStep

Search for all registration domains. These domains can be used to register a service.

searchForServicesOfType: inDomain: 

- (void) searchForServicesOfType: (NSString*)serviceType inDomain: (NSString*)domainName;
Availability: OpenStep

Search for a particular service within a given domain.

setDelegate: 

- (void) setDelegate: (id)delegate;
Availability: OpenStep

Sets the receiver's delegate.

stop 

- (void) stop;
Availability: OpenStep

Halts all currently running searches.

NSObject (NSNetServiceBrowserDelegateMethods) class description

NSObject(NSNetServiceBrowserDelegateMethods)

Declared in:
Foundation/NSNetServices.h
Availability: OpenStep

This informal protocol must be adopted by any class wishing to implement an NSNetServiceBrowser delegate.

Method summary

netServiceBrowser: didFindDomain: moreComing: 

- (void) netServiceBrowser: (NSNetServiceBrowser*)aNetServiceBrowser didFindDomain: (NSString*)domainString moreComing: (BOOL)moreComing;
Availability: OpenStep


netServiceBrowser: didFindService: moreComing: 

- (void) netServiceBrowser: (NSNetServiceBrowser*)aNetServiceBrowser didFindService: (NSNetService*)aNetService moreComing: (BOOL)moreComing;
Availability: OpenStep

Notifies the delegate that a service was found.

See also:
[NSNetServiceBrowser -searchForServicesOfType:inDomain:]


netServiceBrowser: didNotSearch: 

- (void) netServiceBrowser: (NSNetServiceBrowser*)aNetServiceBrowser didNotSearch: (NSDictionary*)errorDict;
Availability: OpenStep

Notifies the delegate that the search was unsuccessful.

See also:
[NSNetServiceBrowser -netServiceBrowserWillSearch:]


netServiceBrowser: didRemoveDomain: moreComing: 

- (void) netServiceBrowser: (NSNetServiceBrowser*)aNetServiceBrowser didRemoveDomain: (NSString*)domainString moreComing: (BOOL)moreComing;
Availability: OpenStep

Notifies the delegate that a domain has become unavailable.

See also:


netServiceBrowser: didRemoveService: moreComing: 

- (void) netServiceBrowser: (NSNetServiceBrowser*)aNetServiceBrowser didRemoveService: (NSNetService*)aNetService moreComing: (BOOL)moreComing;
Availability: OpenStep

Notifies the delegate that a service has become unavailable.

See also:


netServiceBrowserDidStopSearch: 

- (void) netServiceBrowserDidStopSearch: (NSNetServiceBrowser*)aNetServiceBrowser;
Availability: OpenStep

Notifies the delegate that the search was stopped.

See also:
[NSNetServiceBrowser -stop]


netServiceBrowserWillSearch: 

- (void) netServiceBrowserWillSearch: (NSNetServiceBrowser*)aNetServiceBrowser;
Availability: OpenStep

Notifies the delegate that the search is about to begin.

See also:
[NSNetServiceBrowser -netServiceBrowser:didNotSearch:]


NSObject (NSNetServiceDelegateMethods) class description

NSObject(NSNetServiceDelegateMethods)

Declared in:
Foundation/NSNetServices.h
Availability: OpenStep

This informal protocol must be adopted by any class wishing to implement an NSNetService delegate.

Method summary

netService: didNotPublish: 

- (void) netService: (NSNetService*)sender didNotPublish: (NSDictionary*)errorDict;
Availability: OpenStep

Notifies the delegate that the service could not get published.

See also:
[NSNetService -publish]


netService: didNotResolve: 

- (void) netService: (NSNetService*)sender didNotResolve: (NSDictionary*)errorDict;
Availability: OpenStep

Notifies the delegate that the service could not get resolved.

See also:
[NSNetService -resolveWithTimeout:]


netService: didUpdateTXTRecordData: 

- (void) netService: (NSNetService*)sender didUpdateTXTRecordData: (NSData*)data;
Availability: OpenStep

Notifies the delegate that the TXT record has been updated.

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


netServiceDidPublish: 

- (void) netServiceDidPublish: (NSNetService*)sender;
Availability: OpenStep

Notifies the delegate that the service was successfully published.

See also:
[NSNetService -publish]


netServiceDidResolveAddress: 

- (void) netServiceDidResolveAddress: (NSNetService*)sender;
Availability: OpenStep

Notifies the delegate that the service was resolved.

See also:
[NSNetService -resolveWithTimeout:]


netServiceDidStop: 

- (void) netServiceDidStop: (NSNetService*)sender;
Availability: OpenStep

Notifies the delegate that the request was stopped.

See also:
[NSNetService -stop]


netServiceWillPublish: 

- (void) netServiceWillPublish: (NSNetService*)sender;
Availability: OpenStep

Notifies the delegate that the network is ready to publish the service.

See also:
[NSNetService -publish]


netServiceWillResolve: 

- (void) netServiceWillResolve: (NSNetService*)sender;
Availability: OpenStep

Notifies the delegate that the network is ready to resolve the service.

See also:
[NSNetService -resolveWithTimeout:]



Up