Bonjour/MYBonjourQuery.h
author Jens Alfke <jens@mooseyard.com>
Sat May 16 14:10:15 2009 -0700 (2009-05-16)
changeset 47 60f2b46d9a3b
permissions -rw-r--r--
* Fixed #9: compilation error with iPhone 3.0 SDK.
* MYBonjourRegistration now allows you to set a TXT dictionary with non-NSData key values; they'll be translated to UTF-8 object descriptions. Useful for NSStrings and NSNumbers.
     1 //
     2 //  MYBonjourQuery.h
     3 //  MYNetwork
     4 //
     5 //  Created by Jens Alfke on 4/24/09.
     6 //  Copyright 2009 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import "MYDNSService.h"
    10 @class MYBonjourService;
    11 
    12 
    13 /** A query for a particular DNS record (TXT, NULL, etc.) of a Bonjour service.
    14     This class is used internally by MYBonjourService to track the TXT record;
    15     you won't need to use it directly, unless you're interested in the contents of some other
    16     record (such as the NULL record that iChat's _presence._tcp service uses for buddy icons.) */
    17 @interface MYBonjourQuery : MYDNSService 
    18 {
    19     @private
    20     MYBonjourService *_bonjourService;
    21     uint16_t _recordType;
    22     NSData *_recordData;
    23 }
    24 
    25 /** Initializes a query for a particular service and record type.
    26     @param service  The Bonjour service to query
    27     @param recordType  The DNS record type, e.g. kDNSServiceType_TXT; see the enum in <dns_sd.h>. */
    28 - (id) initWithBonjourService: (MYBonjourService*)service 
    29                    recordType: (uint16_t)recordType;
    30 
    31 /** The data of the DNS record, once it's been found.
    32     This property is KV-observable. */
    33 @property (readonly,copy) NSData *recordData;
    34 
    35 @end