bug fixes and improvements to new bonjour classes and tcplistener, also added a static library target
1.1 --- a/Bonjour/MYAddressLookup.m Wed Apr 29 21:05:01 2009 -0700
1.2 +++ b/Bonjour/MYAddressLookup.m Tue May 05 23:24:50 2009 -0700
1.3 @@ -25,7 +25,7 @@
1.4 return nil;
1.5 }
1.6 _hostname = [hostname copy];
1.7 - _addresses = [[NSMutableArray alloc] init];
1.8 + _addresses = [[NSMutableSet alloc] init];
1.9 }
1.10 return self;
1.11 }
1.12 @@ -62,10 +62,24 @@
1.13 if (address) {
1.14 if (flags & kDNSServiceFlagsAdd) {
1.15 LogTo(DNS,@"%@ got %@ [TTL = %u]", self, address, ttl);
1.16 + NSSet *changedObjects = [NSSet setWithObject:address];
1.17 + [self willChangeValueForKey:@"addresses"
1.18 + withSetMutation:NSKeyValueUnionSetMutation
1.19 + usingObjects:changedObjects];
1.20 [_addresses addObject: address];
1.21 + [self didChangeValueForKey:@"addresses"
1.22 + withSetMutation:NSKeyValueUnionSetMutation
1.23 + usingObjects:changedObjects];
1.24 } else {
1.25 LogTo(DNS,@"%@ lost %@ [TTL = %u]", self, address, ttl);
1.26 + NSSet *changedObjects = [NSSet setWithObject:address];
1.27 + [self willChangeValueForKey:@"addresses"
1.28 + withSetMutation:NSKeyValueMinusSetMutation
1.29 + usingObjects:changedObjects];
1.30 [_addresses removeObject: address];
1.31 + [self didChangeValueForKey:@"addresses"
1.32 + withSetMutation:NSKeyValueMinusSetMutation
1.33 + usingObjects:changedObjects];
1.34 }
1.35 [address release];
1.36 }
1.37 @@ -96,7 +110,16 @@
1.38
1.39
1.40 - (DNSServiceErrorType) createServiceRef: (DNSServiceRef*)sdRefPtr {
1.41 - [_addresses removeAllObjects];
1.42 + if ([_addresses count] > 0) {
1.43 + NSSet *changedObjects = [NSSet setWithSet:_addresses];
1.44 + [self willChangeValueForKey:@"addresses"
1.45 + withSetMutation:NSKeyValueMinusSetMutation
1.46 + usingObjects:changedObjects];
1.47 + [_addresses removeAllObjects];
1.48 + [self didChangeValueForKey:@"addresses"
1.49 + withSetMutation:NSKeyValueMinusSetMutation
1.50 + usingObjects:changedObjects];
1.51 + }
1.52 return DNSServiceGetAddrInfo(sdRefPtr,
1.53 kDNSServiceFlagsShareConnection,
1.54 _interfaceIndex, 0,
2.1 --- a/Bonjour/MYBonjourService.h Wed Apr 29 21:05:01 2009 -0700
2.2 +++ b/Bonjour/MYBonjourService.h Tue May 05 23:24:50 2009 -0700
2.3 @@ -54,6 +54,7 @@
2.4 /** Returns a MYDNSLookup object that resolves the raw IP address(es) of this service.
2.5 Subsequent calls to this method will always return the same object. */
2.6 - (MYAddressLookup*) addressLookup;
2.7 +- (MYAddressLookup*) addressLookupObservingNewAddresses:(NSObject *)observer;
2.8
2.9 //@}
2.10
3.1 --- a/Bonjour/MYBonjourService.m Wed Apr 29 21:05:01 2009 -0700
3.2 +++ b/Bonjour/MYBonjourService.m Tue May 05 23:24:50 2009 -0700
3.3 @@ -232,8 +232,7 @@
3.4 &resolveCallback, self);
3.5 }
3.6
3.7 -
3.8 -- (MYAddressLookup*) addressLookup {
3.9 +- (MYAddressLookup*) addressLookupObservingNewAddresses:(NSObject *)observer {
3.10 if (!_addressLookup) {
3.11 // Create the lookup the first time this is called:
3.12 _addressLookup = [[MYAddressLookup alloc] initWithHostname: self.hostname];
3.13 @@ -241,10 +240,17 @@
3.14 _addressLookup.interfaceIndex = _interfaceIndex;
3.15 }
3.16 // (Re)start the lookup if it's expired:
3.17 - if (_addressLookup && _addressLookup.timeToLive <= 0.0)
3.18 + if (_addressLookup && _addressLookup.timeToLive <= 0.0) {
3.19 + if (observer != nil) {
3.20 + [_addressLookup addObserver:observer forKeyPath:@"addresses" options:NSKeyValueObservingOptionNew context:NULL];
3.21 + }
3.22 [_addressLookup start];
3.23 + }
3.24 return _addressLookup;
3.25 }
3.26 +- (MYAddressLookup*) addressLookup {
3.27 + return [self addressLookupObservingNewAddresses:nil];
3.28 +}
3.29
3.30
3.31 - (MYBonjourQuery*) queryForRecord: (UInt16)recordType {
4.1 --- a/MYNetwork-iPhone.xcodeproj/project.pbxproj Wed Apr 29 21:05:01 2009 -0700
4.2 +++ b/MYNetwork-iPhone.xcodeproj/project.pbxproj Tue May 05 23:24:50 2009 -0700
4.3 @@ -48,6 +48,40 @@
4.4 27D915CB0FA8EAD0002B0DEC /* MYBonjourQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D915C60FA8EAD0002B0DEC /* MYBonjourQuery.m */; };
4.5 27D915CC0FA8EAD0002B0DEC /* MYBonjourRegistration.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D915C80FA8EAD0002B0DEC /* MYBonjourRegistration.m */; };
4.6 280E754F0DD40C5E005A515E /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 280E754C0DD40C5E005A515E /* MainWindow.xib */; };
4.7 + 384A72AE0FB00523006A0B19 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
4.8 + 384A72AF0FB00523006A0B19 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 270E9B4E0EE63F8F003F17CA /* CFNetwork.framework */; };
4.9 + 384A72B00FB00523006A0B19 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 270E9AE80EE61167003F17CA /* libz.dylib */; };
4.10 + 384A72B10FB00523006A0B19 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
4.11 + 384A72B20FB00523006A0B19 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2777C78C0F75E141007F8D30 /* Security.framework */; };
4.12 + 384A72B70FB0062C006A0B19 /* ConcurrentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 384A72B60FB0062C006A0B19 /* ConcurrentOperation.m */; };
4.13 + 384A72B80FB006DF006A0B19 /* IPAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AA20EE61113003F17CA /* IPAddress.m */; };
4.14 + 384A72B90FB006DF006A0B19 /* TCPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AA50EE61113003F17CA /* TCPConnection.m */; };
4.15 + 384A72BA0FB006DF006A0B19 /* TCPEndpoint.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AA70EE61113003F17CA /* TCPEndpoint.m */; };
4.16 + 384A72BB0FB006DF006A0B19 /* TCPListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AA90EE61113003F17CA /* TCPListener.m */; };
4.17 + 384A72BC0FB006DF006A0B19 /* TCPStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AAB0EE61113003F17CA /* TCPStream.m */; };
4.18 + 384A72BD0FB006DF006A0B19 /* TCPWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AAD0EE61113003F17CA /* TCPWriter.m */; };
4.19 + 384A72BE0FB006DF006A0B19 /* BLIPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AB20EE61113003F17CA /* BLIPConnection.m */; };
4.20 + 384A72BF0FB006DF006A0B19 /* BLIPDispatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AB40EE61113003F17CA /* BLIPDispatcher.m */; };
4.21 + 384A72C00FB006DF006A0B19 /* BLIPMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AB60EE61113003F17CA /* BLIPMessage.m */; };
4.22 + 384A72C10FB006DF006A0B19 /* BLIPRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AB80EE61113003F17CA /* BLIPRequest.m */; };
4.23 + 384A72C20FB006DF006A0B19 /* BLIPProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9ABA0EE61113003F17CA /* BLIPProperties.m */; };
4.24 + 384A72C30FB006DF006A0B19 /* BLIPReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9ABC0EE61113003F17CA /* BLIPReader.m */; };
4.25 + 384A72C40FB006DF006A0B19 /* BLIPWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9ABE0EE61113003F17CA /* BLIPWriter.m */; };
4.26 + 384A72C50FB006DF006A0B19 /* CollectionUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AD10EE6111A003F17CA /* CollectionUtils.m */; };
4.27 + 384A72C60FB006DF006A0B19 /* ExceptionUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AD30EE6111A003F17CA /* ExceptionUtils.m */; };
4.28 + 384A72C70FB006DF006A0B19 /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AD50EE6111A003F17CA /* Logging.m */; };
4.29 + 384A72C80FB006DF006A0B19 /* Target.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AD70EE6111A003F17CA /* Target.m */; };
4.30 + 384A72C90FB006DF006A0B19 /* Test.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9AD90EE6111A003F17CA /* Test.m */; };
4.31 + 384A72CA0FB006DF006A0B19 /* GTMNSData+zlib.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E9ADD0EE6111A003F17CA /* GTMNSData+zlib.m */; };
4.32 + 384A72CB0FB006DF006A0B19 /* MYPortMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 278C1B2C0F9F865800954AE1 /* MYPortMapper.m */; };
4.33 + 384A72CC0FB006DF006A0B19 /* PortMapperTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 278C1B2D0F9F865800954AE1 /* PortMapperTest.m */; };
4.34 + 384A72CD0FB006DF006A0B19 /* MYDNSService.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D915BC0FA8EABC002B0DEC /* MYDNSService.m */; };
4.35 + 384A72CE0FB006DF006A0B19 /* MYAddressLookup.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D915BE0FA8EABC002B0DEC /* MYAddressLookup.m */; };
4.36 + 384A72CF0FB006DF006A0B19 /* MYBonjourBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D915C20FA8EAD0002B0DEC /* MYBonjourBrowser.m */; };
4.37 + 384A72D00FB006DF006A0B19 /* MYBonjourService.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D915C40FA8EAD0002B0DEC /* MYBonjourService.m */; };
4.38 + 384A72D10FB006DF006A0B19 /* MYBonjourQuery.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D915C60FA8EAD0002B0DEC /* MYBonjourQuery.m */; };
4.39 + 384A72D20FB006DF006A0B19 /* MYBonjourRegistration.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D915C80FA8EAD0002B0DEC /* MYBonjourRegistration.m */; };
4.40 + 384A72D30FB006DF006A0B19 /* ConcurrentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 384A72B60FB0062C006A0B19 /* ConcurrentOperation.m */; };
4.41 /* End PBXBuildFile section */
4.42
4.43 /* Begin PBXFileReference section */
4.44 @@ -127,6 +161,9 @@
4.45 27D915C80FA8EAD0002B0DEC /* MYBonjourRegistration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MYBonjourRegistration.m; path = Bonjour/MYBonjourRegistration.m; sourceTree = "<group>"; };
4.46 280E754C0DD40C5E005A515E /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
4.47 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iPhone/main.m; sourceTree = "<group>"; };
4.48 + 384A72A90FB0050B006A0B19 /* libMYNetwork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMYNetwork.a; sourceTree = BUILT_PRODUCTS_DIR; };
4.49 + 384A72B50FB0062C006A0B19 /* ConcurrentOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConcurrentOperation.h; sourceTree = "<group>"; };
4.50 + 384A72B60FB0062C006A0B19 /* ConcurrentOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ConcurrentOperation.m; sourceTree = "<group>"; };
4.51 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4.52 /* End PBXFileReference section */
4.53
4.54 @@ -143,6 +180,18 @@
4.55 );
4.56 runOnlyForDeploymentPostprocessing = 0;
4.57 };
4.58 + 384A72A70FB0050B006A0B19 /* Frameworks */ = {
4.59 + isa = PBXFrameworksBuildPhase;
4.60 + buildActionMask = 2147483647;
4.61 + files = (
4.62 + 384A72AE0FB00523006A0B19 /* Foundation.framework in Frameworks */,
4.63 + 384A72AF0FB00523006A0B19 /* CFNetwork.framework in Frameworks */,
4.64 + 384A72B00FB00523006A0B19 /* libz.dylib in Frameworks */,
4.65 + 384A72B10FB00523006A0B19 /* UIKit.framework in Frameworks */,
4.66 + 384A72B20FB00523006A0B19 /* Security.framework in Frameworks */,
4.67 + );
4.68 + runOnlyForDeploymentPostprocessing = 0;
4.69 + };
4.70 /* End PBXFrameworksBuildPhase section */
4.71
4.72 /* Begin PBXGroup section */
4.73 @@ -150,6 +199,7 @@
4.74 isa = PBXGroup;
4.75 children = (
4.76 1D6058910D05DD3D006BFB54 /* BLIPEcho.app */,
4.77 + 384A72A90FB0050B006A0B19 /* libMYNetwork.a */,
4.78 );
4.79 name = Products;
4.80 sourceTree = "<group>";
4.81 @@ -220,6 +270,8 @@
4.82 270E9ACD0EE6111A003F17CA /* MYUtilities */ = {
4.83 isa = PBXGroup;
4.84 children = (
4.85 + 384A72B50FB0062C006A0B19 /* ConcurrentOperation.h */,
4.86 + 384A72B60FB0062C006A0B19 /* ConcurrentOperation.m */,
4.87 270E9ACE0EE6111A003F17CA /* MYUtilitiesTest_main.m */,
4.88 270E9ACF0EE6111A003F17CA /* MYUtilities_Prefix.pch */,
4.89 270E9AD00EE6111A003F17CA /* CollectionUtils.h */,
4.90 @@ -345,6 +397,16 @@
4.91 };
4.92 /* End PBXGroup section */
4.93
4.94 +/* Begin PBXHeadersBuildPhase section */
4.95 + 384A72A50FB0050B006A0B19 /* Headers */ = {
4.96 + isa = PBXHeadersBuildPhase;
4.97 + buildActionMask = 2147483647;
4.98 + files = (
4.99 + );
4.100 + runOnlyForDeploymentPostprocessing = 0;
4.101 + };
4.102 +/* End PBXHeadersBuildPhase section */
4.103 +
4.104 /* Begin PBXNativeTarget section */
4.105 1D6058900D05DD3D006BFB54 /* MYNetwork-iPhone */ = {
4.106 isa = PBXNativeTarget;
4.107 @@ -363,6 +425,23 @@
4.108 productReference = 1D6058910D05DD3D006BFB54 /* BLIPEcho.app */;
4.109 productType = "com.apple.product-type.application";
4.110 };
4.111 + 384A72A80FB0050B006A0B19 /* MYNetwork */ = {
4.112 + isa = PBXNativeTarget;
4.113 + buildConfigurationList = 384A72B40FB00534006A0B19 /* Build configuration list for PBXNativeTarget "MYNetwork" */;
4.114 + buildPhases = (
4.115 + 384A72A50FB0050B006A0B19 /* Headers */,
4.116 + 384A72A60FB0050B006A0B19 /* Sources */,
4.117 + 384A72A70FB0050B006A0B19 /* Frameworks */,
4.118 + );
4.119 + buildRules = (
4.120 + );
4.121 + dependencies = (
4.122 + );
4.123 + name = MYNetwork;
4.124 + productName = MYNetwork;
4.125 + productReference = 384A72A90FB0050B006A0B19 /* libMYNetwork.a */;
4.126 + productType = "com.apple.product-type.library.static";
4.127 + };
4.128 /* End PBXNativeTarget section */
4.129
4.130 /* Begin PBXProject section */
4.131 @@ -383,6 +462,7 @@
4.132 projectRoot = "";
4.133 targets = (
4.134 1D6058900D05DD3D006BFB54 /* MYNetwork-iPhone */,
4.135 + 384A72A80FB0050B006A0B19 /* MYNetwork */,
4.136 );
4.137 };
4.138 /* End PBXProject section */
4.139 @@ -438,6 +518,42 @@
4.140 27D915CA0FA8EAD0002B0DEC /* MYBonjourService.m in Sources */,
4.141 27D915CB0FA8EAD0002B0DEC /* MYBonjourQuery.m in Sources */,
4.142 27D915CC0FA8EAD0002B0DEC /* MYBonjourRegistration.m in Sources */,
4.143 + 384A72B70FB0062C006A0B19 /* ConcurrentOperation.m in Sources */,
4.144 + );
4.145 + runOnlyForDeploymentPostprocessing = 0;
4.146 + };
4.147 + 384A72A60FB0050B006A0B19 /* Sources */ = {
4.148 + isa = PBXSourcesBuildPhase;
4.149 + buildActionMask = 2147483647;
4.150 + files = (
4.151 + 384A72B80FB006DF006A0B19 /* IPAddress.m in Sources */,
4.152 + 384A72B90FB006DF006A0B19 /* TCPConnection.m in Sources */,
4.153 + 384A72BA0FB006DF006A0B19 /* TCPEndpoint.m in Sources */,
4.154 + 384A72BB0FB006DF006A0B19 /* TCPListener.m in Sources */,
4.155 + 384A72BC0FB006DF006A0B19 /* TCPStream.m in Sources */,
4.156 + 384A72BD0FB006DF006A0B19 /* TCPWriter.m in Sources */,
4.157 + 384A72BE0FB006DF006A0B19 /* BLIPConnection.m in Sources */,
4.158 + 384A72BF0FB006DF006A0B19 /* BLIPDispatcher.m in Sources */,
4.159 + 384A72C00FB006DF006A0B19 /* BLIPMessage.m in Sources */,
4.160 + 384A72C10FB006DF006A0B19 /* BLIPRequest.m in Sources */,
4.161 + 384A72C20FB006DF006A0B19 /* BLIPProperties.m in Sources */,
4.162 + 384A72C30FB006DF006A0B19 /* BLIPReader.m in Sources */,
4.163 + 384A72C40FB006DF006A0B19 /* BLIPWriter.m in Sources */,
4.164 + 384A72C50FB006DF006A0B19 /* CollectionUtils.m in Sources */,
4.165 + 384A72C60FB006DF006A0B19 /* ExceptionUtils.m in Sources */,
4.166 + 384A72C70FB006DF006A0B19 /* Logging.m in Sources */,
4.167 + 384A72C80FB006DF006A0B19 /* Target.m in Sources */,
4.168 + 384A72C90FB006DF006A0B19 /* Test.m in Sources */,
4.169 + 384A72CA0FB006DF006A0B19 /* GTMNSData+zlib.m in Sources */,
4.170 + 384A72CB0FB006DF006A0B19 /* MYPortMapper.m in Sources */,
4.171 + 384A72CC0FB006DF006A0B19 /* PortMapperTest.m in Sources */,
4.172 + 384A72CD0FB006DF006A0B19 /* MYDNSService.m in Sources */,
4.173 + 384A72CE0FB006DF006A0B19 /* MYAddressLookup.m in Sources */,
4.174 + 384A72CF0FB006DF006A0B19 /* MYBonjourBrowser.m in Sources */,
4.175 + 384A72D00FB006DF006A0B19 /* MYBonjourService.m in Sources */,
4.176 + 384A72D10FB006DF006A0B19 /* MYBonjourQuery.m in Sources */,
4.177 + 384A72D20FB006DF006A0B19 /* MYBonjourRegistration.m in Sources */,
4.178 + 384A72D30FB006DF006A0B19 /* ConcurrentOperation.m in Sources */,
4.179 );
4.180 runOnlyForDeploymentPostprocessing = 0;
4.181 };
4.182 @@ -460,6 +576,31 @@
4.183 };
4.184 name = Release;
4.185 };
4.186 + 384A72AA0FB0050C006A0B19 /* Debug */ = {
4.187 + isa = XCBuildConfiguration;
4.188 + buildSettings = {
4.189 + ALWAYS_SEARCH_USER_PATHS = NO;
4.190 + COPY_PHASE_STRIP = NO;
4.191 + GCC_DYNAMIC_NO_PIC = NO;
4.192 + GCC_OPTIMIZATION_LEVEL = 0;
4.193 + PREBINDING = NO;
4.194 + PRODUCT_NAME = MYNetwork;
4.195 + };
4.196 + name = Debug;
4.197 + };
4.198 + 384A72AB0FB0050C006A0B19 /* Release */ = {
4.199 + isa = XCBuildConfiguration;
4.200 + buildSettings = {
4.201 + ALWAYS_SEARCH_USER_PATHS = NO;
4.202 + COPY_PHASE_STRIP = YES;
4.203 + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
4.204 + GCC_ENABLE_FIX_AND_CONTINUE = NO;
4.205 + PREBINDING = NO;
4.206 + PRODUCT_NAME = MYNetwork;
4.207 + ZERO_LINK = NO;
4.208 + };
4.209 + name = Release;
4.210 + };
4.211 C01FCF4F08A954540054247B /* Debug */ = {
4.212 isa = XCBuildConfiguration;
4.213 baseConfigurationReference = 278C1B330F9F86A100954AE1 /* MYUtilities_Debug.xcconfig */;
4.214 @@ -494,6 +635,15 @@
4.215 defaultConfigurationIsVisible = 0;
4.216 defaultConfigurationName = Release;
4.217 };
4.218 + 384A72B40FB00534006A0B19 /* Build configuration list for PBXNativeTarget "MYNetwork" */ = {
4.219 + isa = XCConfigurationList;
4.220 + buildConfigurations = (
4.221 + 384A72AA0FB0050C006A0B19 /* Debug */,
4.222 + 384A72AB0FB0050C006A0B19 /* Release */,
4.223 + );
4.224 + defaultConfigurationIsVisible = 0;
4.225 + defaultConfigurationName = Release;
4.226 + };
4.227 C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MYNetwork-iPhone" */ = {
4.228 isa = XCConfigurationList;
4.229 buildConfigurations = (
5.1 --- a/TCP/TCPListener.m Wed Apr 29 21:05:01 2009 -0700
5.2 +++ b/TCP/TCPListener.m Tue May 05 23:24:50 2009 -0700
5.3 @@ -24,6 +24,7 @@
5.4
5.5 @interface TCPListener()
5.6 - (void) _openBonjour;
5.7 +- (void) _publishBonjour;
5.8 - (void) _closeBonjour;
5.9 @property BOOL bonjourPublished;
5.10 @property NSInteger bonjourError;
5.11 @@ -248,6 +249,11 @@
5.12 #pragma mark -
5.13 #pragma mark BONJOUR:
5.14
5.15 +// subclasses can override if they want to call publishWithOptions: instead of publish
5.16 +- (void) _publishBonjour
5.17 +{
5.18 + [_netService publish];
5.19 +}
5.20
5.21 - (void) _openBonjour
5.22 {
5.23 @@ -261,7 +267,7 @@
5.24 [_netService setDelegate:self];
5.25 if( _bonjourTXTRecord )
5.26 [self _updateTXTRecord];
5.27 - [_netService publish];
5.28 + [self _publishBonjour];
5.29 } else {
5.30 self.bonjourError = -1;
5.31 Warn(@"%@: Failed to create NSNetService",self);
5.32 @@ -322,7 +328,7 @@
5.33 }
5.34
5.35
5.36 -- (void)netServiceWillPublish:(NSNetService *)sender
5.37 +- (void)netServiceDidPublish:(NSNetService *)sender
5.38 {
5.39 LogTo(BLIP,@"%@: Advertising %@",self,sender);
5.40 self.bonjourPublished = YES;