Skip navigation.
 
mlRe: Distributed Objects and Bonjour
FROM : Robert Sesek
DATE : Sat Jul 01 19:54:14 2006

On Jun 29, 2006, at 6:49 PM, Adam R. Maxwell wrote:

>
> On Jun 29, 2006, at 16:11, Robert Sesek wrote:
>

>>
>> On Jun 28, 2006, at 6:22 PM, Adam R. Maxwell wrote:

>

>>>> Finally, would it matter if I'm running the server and the 
>>>> client on the same machine (localhost) over the network? I don't 
>>>> think it should, but I'm wondering if it could be causing any 
>>>> problems. Because I did notice that when, in the client, I did: 
>>>> NSLog(@"service: %@", [netService hostName]); the value was (null).

>>>
>>> If you were able to publish the service successfully, your client 
>>> probably hasn't resolved the service yet with -[NSNetService 
>>> resolveWithTimeout:].  You'll have to do that first, and then 
>>> wait for the delegate method to be called.

>>
>> One thing I notice happening is that in my run log, I get this:
>>
>> 2006-06-29 16:02:07.356 Simple Client[891] Warning: -[NSNetService 
>> resolve] is deprecated in Mac OS X 10.4. Please use -[NSNetService 
>> resolveWithTimeout:]
>>
>> I'm not sure what's causing that.

>
> This is from NSSocketPortNameServer; I filed rdar://problem/4507798 
> on this a while ago, since it's confusing to see.
>
> #0    0x92a41760 in -[NSNetService(NSDeprecated) resolve]
> #1    0x92a23adc in -[NSSocketPortNameServer 
> portForName:host:nameServerPortNumber:]


I'll report it, too, to show that there's more interest in getting 
this fixed.

>

>>
>> So I've now changed the structure of the code a little to 
>> implement the delegate system. I set the service's delegate to be 
>> self. Now the only thing that happens in connectToServer: is it 
>> tells the netService to resolveWithTimeout. The rest of the code 
>> from that method is moved to the delegate method 
>> netServiceDidResolveAddress (which runs successfully). And yet, 
>> the application still hangs on the same [connection rootProxy] line.
>>

>
> That sounds right.  What happens if you log the net service name? 
> Is it the same name you registered with NSSocketPortNameServer?
>


That was one of the problems! I wasn't specifying the right service 
name so things weren't matching up properly. After going through all 
your emails and looking at your code, I've finally gotten it to work 
exactly how I want it. Thank you for all your help!

Robert Sesek
Email: <email_removed>
www.iris-studios.com

Related mailsAuthorDate
mlDistributed Objects and Bonjour Robert Sesek Jun 26, 20:37
mlDistributed Objects and Bonjour Robert Sesek Jun 26, 20:40
mlRe: Distributed Objects and Bonjour Robert Sesek Jun 27, 17:47
mlRe: Distributed Objects and Bonjour Robert Sesek Jun 27, 19:57
mlRe: Distributed Objects and Bonjour Adam R. Maxwell Jun 28, 16:35
mlRe: Distributed Objects and Bonjour Adam R. Maxwell Jun 29, 03:22
mlRe: Distributed Objects and Bonjour Robert Sesek Jun 30, 01:11
mlRe: Distributed Objects and Bonjour Adam R. Maxwell Jun 30, 03:49
mlRe: Distributed Objects and Bonjour Robert Sesek Jul 1, 19:54