How can I find the IP of a network service from the iPhone
I want to use some sort of nmap-like functionality to autodiscover a ASP.NET web server (r开发者_运维问答unning on port 443) somewhere on the network. This way users don't have to find and enter the IP manually. Is there a good/clean way to do this?
Thanks to @ceejaoz's comment above, I was able to do this pretty easily in Bonjour.
I used Mono.Zeroconf, a .NET/Mono Bonjour library, to advertise the service, and the default iOS NSNetService
stuff to resolve it on the iPhone. (There's plenty of tutorials on how to do this around the nets).
I made a Windows Service in Visual Studio to actually run the code that advertises the ip and port, since a web service isn't really a good place for that.
One big caveat (as of December 2010): the Bonjour DLLs that come with Mono.Zeroconf are totally broken (no errors, they just don't do anything). Steal the ones from Pidgin instead.
精彩评论