Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Distributed Objects and Bonjour




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:]



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?


-- Adam

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Distributed Objects and Bonjour (From: Robert Sesek <email@hidden>)
 >Re: Distributed Objects and Bonjour (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Distributed Objects and Bonjour (From: "Adam R. Maxwell" <email@hidden>)
 >Re: Distributed Objects and Bonjour (From: Robert Sesek <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.