Bonjour/MYBonjourBrowser.h
author Jens Alfke <jens@mooseyard.com>
Tue Jul 21 15:06:15 2009 -0700 (2009-07-21)
changeset 62 8713f2d6a4c5
parent 50 63baa74c903f
permissions -rw-r--r--
Added -[MYBonjourRegistration updateTXTRecord]
jens@26
     1
//
jens@26
     2
//  MYBonjourBrowser.h
jens@26
     3
//  MYNetwork
jens@26
     4
//
jens@26
     5
//  Created by Jens Alfke on 1/22/08.
jens@26
     6
//  Copyright 2008 Jens Alfke. All rights reserved.
jens@26
     7
//
jens@26
     8
jens@28
     9
#import "MYDNSService.h"
jens@31
    10
@class MYBonjourRegistration;
jens@26
    11
jens@26
    12
jens@26
    13
/** Searches for Bonjour services of a specific type. */
jens@28
    14
@interface MYBonjourBrowser : MYDNSService
jens@26
    15
{
jens@26
    16
    @private
jens@26
    17
    NSString *_serviceType;
jens@26
    18
    BOOL _browsing;
jens@26
    19
    Class _serviceClass;
jens@26
    20
    NSMutableSet *_services, *_addServices, *_rmvServices;
jens@31
    21
    BOOL _pendingUpdate;
jens@31
    22
    MYBonjourRegistration *_myRegistration;
jens@59
    23
    id _delegate;
jens@26
    24
}
jens@26
    25
jens@50
    26
/** Initializes a new MYBonjourBrowser.
jens@26
    27
    Call -start to begin browsing.
jens@26
    28
    @param serviceType  The name of the service type to look for, e.g. "_http._tcp". */
jens@26
    29
- (id) initWithServiceType: (NSString*)serviceType;
jens@26
    30
jens@59
    31
@property (assign) id delegate;
jens@59
    32
jens@26
    33
/** Is the browser currently browsing? */
jens@26
    34
@property (readonly) BOOL browsing;
jens@26
    35
jens@26
    36
/** The set of currently found services. These are instances of the serviceClass,
jens@50
    37
    which is MYBonjourService by default.
jens@26
    38
    This is KV-observable. */
jens@26
    39
@property (readonly) NSSet *services;
jens@26
    40
jens@26
    41
/** The class of objects to create to represent services.
jens@50
    42
    The default value is [MYBonjourService class]; you can change this, but only
jens@26
    43
    to a subclass of that. */
jens@26
    44
@property Class serviceClass;
jens@26
    45
jens@31
    46
/** My own registration for this service type.
jens@31
    47
    This object is created on demand and won't be started up until you tell it to.
jens@31
    48
    Before starting it, you'll need to set its port, and optionally its name.
jens@31
    49
    Your own registration will _not_ be visible in the set of services.*/
jens@31
    50
@property (readonly) MYBonjourRegistration *myRegistration;
jens@31
    51
jens@26
    52
@end