Re: Gluing from NSNetService to FSMountServerVolumeSync()
Re: Gluing from NSNetService to FSMountServerVolumeSync()
- Subject: Re: Gluing from NSNetService to FSMountServerVolumeSync()
- From: Jens Alfke <email@hidden>
- Date: Sun, 28 Jun 2009 22:30:34 -0700
On Jun 27, 2009, at 10:37 PM, Jerry Krinock wrote:
I discover NSNetService objects on the local network using
NSNetServiceBrowser, and need to mount such a service using
FSMountServerVolumeSync().
It does not work if in the URL I use the -name of the NSNetService
(which is also the "Computer Name"):
afp://Newhall/NewhallHD
The name of the service is unrelated to the DNS hostname of the
computer it runs on. It's just an arbitrary name chosen by the process
that registers the service. The service name is just intended to be
displayed to a user, like in a browser UI.
Someone please embarrass me by naming the one-line API that I could
have used to find the computer names and IP addresses of the servers
on the local network.
It takes more than one line because it's asynchronous. You call -
resolveWithTimeout: (not the old -resolve method, which is deprecated)
and wait for a callback.
I agree, it's somewhat annoying to have to tweeze the address out of
the struct sockaddr wrapped in an NSData. This would be a cleaner API
if Cocoa had an "NSIPAddress" class, but for some reason it doesn't.
(For what it's worth, my MYNetwork library that I just advertised in
an earlier reply does have such a class.)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden