Bonjour/MYBonjourService.h
changeset 38 f090fd705556
parent 28 732576fa8a0d
child 43 aab592ac36fc
     1.1 --- a/Bonjour/MYBonjourService.h	Mon Apr 27 09:03:56 2009 -0700
     1.2 +++ b/Bonjour/MYBonjourService.h	Tue May 05 15:11:02 2009 -0700
     1.3 @@ -33,13 +33,34 @@
     1.4  /** The service's domain. */
     1.5  @property (readonly) NSString *domain;
     1.6  
     1.7 +/** The service's full name -- the name, type and domain concatenated together. */
     1.8 +@property (readonly,copy) NSString* fullName;
     1.9 +
    1.10 +/** The index of the network interface on which this service was found. */
    1.11 +@property (readonly) uint32_t interfaceIndex;
    1.12 +
    1.13 +
    1.14 +/** @name Addressing
    1.15 + *  Getting the IP address of the service
    1.16 + */
    1.17 +//@{
    1.18 +
    1.19 +/** The hostname of the machine providing this service. */
    1.20  @property (readonly, copy) NSString *hostname;
    1.21  
    1.22 +/** The IP port number of this service on its host. */
    1.23  @property (readonly) UInt16 port;
    1.24  
    1.25 -@property (readonly) uint32_t interfaceIndex;
    1.26 +/** Returns a MYDNSLookup object that resolves the raw IP address(es) of this service.
    1.27 +    Subsequent calls to this method will always return the same object. */
    1.28 +- (MYAddressLookup*) addressLookup;
    1.29  
    1.30 -@property (readonly,copy) NSString* fullName;
    1.31 +//@}
    1.32 +
    1.33 +
    1.34 +/** @name TXT and other DNS records
    1.35 + */
    1.36 +//@{
    1.37  
    1.38  /** The service's metadata dictionary, from its DNS TXT record */
    1.39  @property (readonly,copy) NSDictionary *txtRecord;
    1.40 @@ -47,42 +68,41 @@
    1.41  /** A convenience to access a single property from the TXT record. */
    1.42  - (NSString*) txtStringForKey: (NSString*)key;
    1.43  
    1.44 -/** Returns a MYDNSLookup object that resolves the IP address(es) of this service.
    1.45 -    Subsequent calls to this method will always return the same object. */
    1.46 -- (MYAddressLookup*) addressLookup;
    1.47 -
    1.48  /** Starts a new MYBonjourQuery for the specified DNS record type of this service.
    1.49      @param recordType  The DNS record type, e.g. kDNSServiceType_TXT; see the enum in <dns_sd.h>. */
    1.50  - (MYBonjourQuery*) queryForRecord: (UInt16)recordType;
    1.51  
    1.52 +//@}
    1.53  
    1.54 -// Protected methods, for subclass use only:
    1.55  
    1.56 -// (for subclasses to override, but not call):
    1.57 +/** @name Protected
    1.58 + *  Advanced methods that may be overridden by subclasses, but should not be called directly.
    1.59 + */
    1.60 +//@{
    1.61 +
    1.62 +/** Designated initializer. You probably don't want to create MYBonjourService instances yourself,
    1.63 +    but if you subclass you might need to override this initializer. */
    1.64  - (id) initWithName: (NSString*)serviceName
    1.65                 type: (NSString*)type
    1.66               domain: (NSString*)domain
    1.67 -          interface: (uint32_t)interfaceIndex;
    1.68 +          interface: (UInt32)interfaceIndex;
    1.69  
    1.70 +/** Called when this service is officially added to its browser's service set.
    1.71 +    You can override this, but be sure to call the superclass method. */
    1.72  - (void) added;
    1.73 +
    1.74 +/** Called when this service is officially removed to its browser's service set.
    1.75 +    You can override this, but be sure to call the superclass method. */
    1.76  - (void) removed;
    1.77 +
    1.78 +/** Called when this service's TXT record changes.
    1.79 +    You can override this, but be sure to call the superclass method. */
    1.80  - (void) txtRecordChanged;
    1.81  
    1.82 -// Internal:
    1.83 -
    1.84 +/** Called when a query started by this service updates.
    1.85 +    You can override this, but be sure to call the superclass method. */
    1.86  - (void) queryDidUpdate: (MYBonjourQuery*)query;
    1.87  
    1.88 -@end
    1.89 -
    1.90 -
    1.91 -
    1.92 -@interface MYBonjourResolveOperation : ConcurrentOperation
    1.93 -{
    1.94 -    MYBonjourService *_service;
    1.95 -    NSSet *_addresses;
    1.96 -}
    1.97 -
    1.98 -@property (readonly) MYBonjourService *service;
    1.99 -@property (readonly,retain) NSSet *addresses;
   1.100 +//@}
   1.101  
   1.102  @end