1.1 --- a/PortMapper/MYDNSService.h Fri Apr 24 10:10:32 2009 -0700
1.2 +++ b/PortMapper/MYDNSService.h Mon Apr 27 09:03:56 2009 -0700
1.3 @@ -18,23 +18,27 @@
1.4 CFSocketRef _socket;
1.5 CFRunLoopSourceRef _socketSource;
1.6 SInt32 _error;
1.7 + BOOL _continuous;
1.8 }
1.9
1.10 +/** If NO (the default), the service will stop after it gets a result.
1.11 + If YES, it will continue to run until stopped. */
1.12 +@property BOOL continuous;
1.13 +
1.14 /** Starts the service.
1.15 Returns immediately; you can find out when the service actually starts (or fails to)
1.16 by observing the isOpen and error properties.
1.17 It's very unlikely that this call itself will fail (return NO). If it does, it
1.18 probably means that the mDNSResponder process isn't working. */
1.19 -- (BOOL) open;
1.20 +- (BOOL) start;
1.21
1.22 -- (void) close;
1.23 +/** Stops the service. */
1.24 +- (void) stop;
1.25
1.26
1.27 -@property (readonly) struct _DNSServiceRef_t* serviceRef;
1.28 -
1.29 /** The error status, a DNSServiceErrorType enum; nonzero if something went wrong.
1.30 This property is KV observable. */
1.31 -@property SInt32 error;
1.32 +@property int32_t error;
1.33
1.34 // PROTECTED:
1.35
1.36 @@ -43,6 +47,15 @@
1.37 If an error occurs, the method should set self.error and return NULL.*/
1.38 - (struct _DNSServiceRef_t*) createServiceRef;
1.39
1.40 -- (void) stopService;
1.41 +@property (readonly) struct _DNSServiceRef_t* serviceRef;
1.42 +
1.43 +/** Same as -stop, but does not clear the error property.
1.44 + (The stop method actually calls this first.) */
1.45 +- (void) cancel;
1.46 +
1.47 +/** Block until a message is received from the daemon.
1.48 + This will cause the service's callback (defined by the subclass) to be invoked.
1.49 + @return YES if a message is received, NO on error (or if the service isn't started) */
1.50 +- (BOOL) waitForReply;
1.51
1.52 @end