TCP/TCPListener.m
changeset 43 aab592ac36fc
parent 26 cb9cdf247239
child 44 d8a559a39284
     1.1 --- a/TCP/TCPListener.m	Wed Apr 22 16:45:39 2009 -0700
     1.2 +++ b/TCP/TCPListener.m	Tue May 05 23:24:50 2009 -0700
     1.3 @@ -24,6 +24,7 @@
     1.4  
     1.5  @interface TCPListener()
     1.6  - (void) _openBonjour;
     1.7 +- (void) _publishBonjour;
     1.8  - (void) _closeBonjour;
     1.9  @property BOOL bonjourPublished;
    1.10  @property NSInteger bonjourError;
    1.11 @@ -248,6 +249,11 @@
    1.12  #pragma mark -
    1.13  #pragma mark BONJOUR:
    1.14  
    1.15 +// subclasses can override if they want to call publishWithOptions: instead of publish
    1.16 +- (void) _publishBonjour
    1.17 +{
    1.18 +	[_netService publish];
    1.19 +}
    1.20  
    1.21  - (void) _openBonjour
    1.22  {
    1.23 @@ -261,7 +267,7 @@
    1.24              [_netService setDelegate:self];
    1.25              if( _bonjourTXTRecord )
    1.26                  [self _updateTXTRecord];
    1.27 -            [_netService publish];
    1.28 +			[self _publishBonjour];
    1.29          } else {
    1.30              self.bonjourError = -1;
    1.31              Warn(@"%@: Failed to create NSNetService",self);
    1.32 @@ -322,7 +328,7 @@
    1.33  }
    1.34  
    1.35  
    1.36 -- (void)netServiceWillPublish:(NSNetService *)sender
    1.37 +- (void)netServiceDidPublish:(NSNetService *)sender
    1.38  {
    1.39      LogTo(BLIP,@"%@: Advertising %@",self,sender);
    1.40      self.bonjourPublished = YES;