Rendezvous, NSNetService's resolve doesn't work when not connected
Rendezvous, NSNetService's resolve doesn't work when not connected
- Subject: Rendezvous, NSNetService's resolve doesn't work when not connected
- From: Brant Vasilieff <email@hidden>
- Date: Wed, 18 Sep 2002 21:28:46 -0700
On a local machine, where a client wants to connect to a background
service, calling resolve on a NSNetService to find the actual IP
address and port doesn't call any of the delegate methods if not
connected. It works great if I'm connected to a router, but doesn't do
anything if not connected to anything. The service I'm trying to find
is running on the local machine. If I reconnect the machine then
netServiceDidResolveAddress: gets called immediately.
Isn't the idea behind Rendezvous to not think of machines but rather
services? And should the service be allowed to reside on the same
machine? Even if that machine is say a powerbook?
I was having a related problem earlier where creating the remote
NSSocketPort would block in +[NSHost hostWithName:] if I wasn't
connected to the internet. Although that required an actual connection
to the internet to complete. Possibly needing a DNS server.
I think I fixed that by calling
initRemoteWithProtocolFamily:socketType:protocol:address: instead of
initRemoteWithTCPPort: host:.
So I tried to reproduce the network loss to test it by disconnecting my
machine from the local router. That's when I discovered that resolve
was not resolving. leaving my machine plugged into the router, but
disconnecting the router from the DSL line allowed resolve to work.
Puzzling indeed,
Brant
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.