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?
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.