Question

I am using Objective-C and Java for this, but I think the question is language-neutral.

I have an iOS client that talks to a Java server over TCP/IP. Right now I need to tell at least one of the parties the IP address of the other. Is there a standard way that I can "discover" IP addresses (from one side or the other)?

Also, how would switching to UDP affect the answer?

Was it helpful?

Solution

There are many protocols for discovering other devices/servers on the network. One of the most commonly used in the iOS realm is "Bonjour". Look at Apple's sample apps.

OTHER TIPS

Is there a standard way that I can "discover" IP addresses (from one side or the other)?

Yes, it's called "port sniffing" and will certainly get you in trouble since it's a common kind of attack.

You simply try all IP addresses in a range. Many firewall products will consider this an "intrusion" attempt and log you with the intrusion detection software.

We almost never "discover" addresses.

That's what "domain names" are for.

Why can't the server have a well known DNS name?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top