2

I have multiple computers on a Wifi router. For the iPhone/iPad In objective-c how can I determine what computer is on what tcpip socket address so I can choose and connect to that computer? (each computer is a socket server written in c++ and I need to be able to easily check the status that is out putted)

jdl
  • 6,151
  • 19
  • 83
  • 132
  • Shouldn't you have a map of each computer to each socket address that you're pinging? If you're on the same network, you should be able to see each tcpip – Dominic Tancredi Dec 08 '11 at 18:33
  • Can you use [Bonjour](http://stackoverflow.com/questions/3194215/what-is-bonjour)? – crashmstr Dec 08 '11 at 18:35

2 Answers2

1

If your computers are all Macs, it is pretty easy. Simply use the NSNetservice class to advertise the service and the socket port that you already have.

Then, on the iOS devices, simply use a NSNetServiceBrowser object to look for your particular service by name, and connect to one or all of them as required.

If your computers are not Macs, you can look into Bonjour for Windows, or any Zeroconf implementation such as Avahi on Linux.

Philippe
  • 905
  • 6
  • 18
0

TCP programming

jdl
  • 6,151
  • 19
  • 83
  • 132