Bonjour/MYBonjourBrowser.h
author morrowa
Thu Jul 02 20:45:11 2009 -0700 (2009-07-02)
changeset 57 998dcacd4983
parent 31 1d6924779df7
child 59 46c7844cb592
permissions -rw-r--r--
Merged Jens' latest changes.
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@26
    23
}
jens@26
    24
jens@50
    25
/** Initializes a new MYBonjourBrowser.
jens@26
    26
    Call -start to begin browsing.
jens@26
    27
    @param serviceType  The name of the service type to look for, e.g. "_http._tcp". */
jens@26
    28
- (id) initWithServiceType: (NSString*)serviceType;
jens@26
    29
jens@26
    30
/** Is the browser currently browsing? */
jens@26
    31
@property (readonly) BOOL browsing;
jens@26
    32
jens@26
    33
/** The set of currently found services. These are instances of the serviceClass,
jens@50
    34
    which is MYBonjourService by default.
jens@26
    35
    This is KV-observable. */
jens@26
    36
@property (readonly) NSSet *services;
jens@26
    37
jens@26
    38
/** The class of objects to create to represent services.
jens@50
    39
    The default value is [MYBonjourService class]; you can change this, but only
jens@26
    40
    to a subclass of that. */
jens@26
    41
@property Class serviceClass;
jens@26
    42
jens@31
    43
/** My own registration for this service type.
jens@31
    44
    This object is created on demand and won't be started up until you tell it to.
jens@31
    45
    Before starting it, you'll need to set its port, and optionally its name.
jens@31
    46
    Your own registration will _not_ be visible in the set of services.*/
jens@31
    47
@property (readonly) MYBonjourRegistration *myRegistration;
jens@31
    48
jens@26
    49
@end