Re: Obtaining local host name
Re: Obtaining local host name
- Subject: Re: Obtaining local host name
- From: Peter Sichel <email@hidden>
- Date: Tue, 24 Nov 2009 05:02:31 -0500
On Nov 23, 2009, at 4:41 AM, Quinn wrote:
> At 14:31 -0500 22/11/09, Peter Sichel wrote:
>> What confused me is that the LocalHostName may not exist (be null) until you advertise a service, but the default name for your service will use the computer name. The statement in Sharing Preferences that other hosts on your LAN can access this computer using the LocalHostName is not true in the default case of publishing your own service.
>
> I don't understand this comment. What test are you running and what is going wrong?
My program Phone Amego has a Caller ID sharing feature that allows a copy of the program running on one host to subscribe to another. When you turn on "Caller ID Sharing" the program advertises a service. When you browse for services from another Phone Amego, the service appears with the corresponding "Computer Name."
When the user selects a service and presses "Subscribe", the local instance sends a subscribe request to the remote service that includes the LocalHostName. The remote service then adds this LocalHostName to its publish list. Notice it does not browse for the service name, but receives it in a subscribe request from the client.
This is a bug if the LocalHostName is not the same as the Computer Name. The publish will fail to resolve the corresponding NSNetService. The Sharing Preferences panel says other hosts on your LAN can access this computer using the LocalHostName, but that's not true in the default case of advertising your own service, you must use the local Computer Name or it won't work.
- Peter
_______________________________________________
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