Here's what I have right now...
using [[NSProcessInfo processInfo] hostName], I get names like:
"macintosh-85.resnet.neu.edu"
If the computer broadcasts a NSNetService, then receives its own service, and then resolves the address, it finds the name as being:
"macintosh-85.local." instead
First question: How can I get my program to recognize that the broadcast it's receiving is the same one it sent out?
Second question: Although these names are fine for behind the scenes purposes, I would like to get a name along the lines of
"Xxx Xxx's iMac"
to display to the user.
These friendly looking names (which appear in the sidebar of Finder under SHARED and DEVICES) appear to be set in System Preferences -> Sharing -> Computer Name. Does anyone know how I can access these names from my app? (A solution that works within the sandbox would be preferred, although if anyone knows how to make it work outside the sandbox, I'll happily take that solution and see what I can do with it...)
At the same time, the not so friendly looking name appears to come from just under the setting... the second name seems to be called the the "Local Hostname". I can't figure out what the first name (the one returned by ProcessInfo) is called.
using [[NSProcessInfo processInfo] hostName], I get names like:
"macintosh-85.resnet.neu.edu"
If the computer broadcasts a NSNetService, then receives its own service, and then resolves the address, it finds the name as being:
"macintosh-85.local." instead
First question: How can I get my program to recognize that the broadcast it's receiving is the same one it sent out?
Second question: Although these names are fine for behind the scenes purposes, I would like to get a name along the lines of
"Xxx Xxx's iMac"
to display to the user.
These friendly looking names (which appear in the sidebar of Finder under SHARED and DEVICES) appear to be set in System Preferences -> Sharing -> Computer Name. Does anyone know how I can access these names from my app? (A solution that works within the sandbox would be preferred, although if anyone knows how to make it work outside the sandbox, I'll happily take that solution and see what I can do with it...)
At the same time, the not so friendly looking name appears to come from just under the setting... the second name seems to be called the the "Local Hostname". I can't figure out what the first name (the one returned by ProcessInfo) is called.