Misc. tweaks made while porting Chatty to use MYNetwork.
* Allow -[BLIPConnection sendRequest:] to re-send an already-sent or received request.
* Allow use of the basic -init method for BLIPConnection.
* Some new convenience factory methods.
* Broke dependencies on Security.framework out into new TCPEndpoint+Certs.m source file, so client apps aren't forced to link against Security.
2 // MYBonjourRegistration.h
5 // Created by Jens Alfke on 4/27/09.
6 // Copyright 2009 Jens Alfke. All rights reserved.
9 #import "MYDNSService.h"
10 @class MYBonjourService;
13 /** Registers a local network service with Bonjour, so it can be browsed by other computers. */
14 @interface MYBonjourRegistration : MYDNSService
16 NSString *_name, *_type, *_domain;
20 NSMutableDictionary *_txtRecord;
23 /** Initializes a new registration.
24 If you're also browsing for the same service type, you should instead get an instance of this via
25 the MYBonjourBrowser's 'myRegistration' property -- that way the browser knows about the
26 registration and won't echo it back to you.
27 Either way, don't forget to call -start! */
28 - (id) initWithServiceType: (NSString*)serviceType port: (UInt16)port;
30 /** The name to register this service under.
31 This is often left nil, in which case the user's chosen "Computer Name" (from the Sharing system
32 pref pane) will be used.
33 This can only be set before calling -start! */
34 @property (copy) NSString *name;
36 /** The registration's service type. */
37 @property (readonly) NSString *type;
39 /** The registration's IP port number.
40 You'll need to set this if you got this object from MYBonjourBrowser's 'myRegistration' property,
41 as that object doesn't have a pre-set port number yet.
42 This can only be set before calling -start! */
43 @property UInt16 port;
45 /** The registration's full name -- the name, type and domain concatenated together. */
46 @property (readonly) NSString *fullName;
48 /** Is the registration currently active? */
49 @property (readonly) BOOL registered;
51 /** The service's metadata dictionary, stored in its DNS TXT record */
52 @property (copy) NSDictionary *txtRecord;
54 /** Convenience to store a string value in a single TXT record key. */
55 - (void) setString: (NSString*)value forTxtKey: (NSString*)key;
59 * Advanced methods you likely won't need
63 /** The registration's domain name.
64 This is almost always left nil, in which case the default registration domain is used
66 This can only be set before calling -start! */
67 @property (copy) NSString *domain;
69 /** Determines what to do if there's a name conflict with an already-registered service on the
71 If set to YES (the default), a number will be appended to the name to make it unique.
72 If set to NO, the registration will fail, and you can choose a different name and try again.
73 This can only be set before calling -start! */
74 @property BOOL autoRename;
76 /** Is this browsed service an echo of this local registration? (Compares fullNames.) */
77 - (BOOL) isSameAsService: (MYBonjourService*)service;