Ok so I submitted an app using NSHost, didn't notice that it was a non-public API, my bad.
What I have is this.
I have found alternatives that work when receiving WithName (i.e. a Bonjour advertised service) what I can't do at the minute is work out how to deal with hostWithAddress (necessary as my users can manually enter an IP address to connect to a Windows client)
Does anyone have any great ideas on how I might work around this?
Currently have this
in place which works great for advertised Bonjour services, but not for manually entered IP Addresses.
What I have is this.
Code:
NSHost *host = [NSHost hostWithAddress:hostname];
if (host == nil) {
host = [NSHost hostWithName:hostname];
if (host == nil) {
[self setMessage:@"Invalid IP address or hostname:"];
return;
}
}
I have found alternatives that work when receiving WithName (i.e. a Bonjour advertised service) what I can't do at the minute is work out how to deal with hostWithAddress (necessary as my users can manually enter an IP address to connect to a Windows client)
Does anyone have any great ideas on how I might work around this?
Currently have this
Code:
struct hostent *remoteHostEnt = gethostbyname(hostname);
struct in_addr *remoteInAddr = (struct in_addr *) remoteHostEnt->h_addr_list[0];
char *sRemoteInAddr = inet_ntoa(*remoteInAddr);
NSString *host = [[NSString alloc] initWithFormat:@"Remote IP: %s\n", sRemoteInAddr];