Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a client-server application, which runs in a LAN.

Every time a device connects to this LAN, it should send some data to the server within the LAN, but the device doesn't know the IP address of the server.

Is it possible to solve this with port forwarding?


The devices are android devices, they collect some data in the background and then send it to the server application, which is a java application, and it consumes the data.

As I said, I'm pretty new to networking, and I found some stuff about port forwarding, but it didn't seem to help me. This is why I asked you guys.

Could you explain please this simple name resolution?


share|improve this question
Where do they connect to? Some kind of router? – slhck Apr 21 '12 at 10:19
to the wifi router, sorry. – gjackal Apr 21 '12 at 10:20
up vote 1 down vote accepted

If you don't know the IP address of the target device, you can only work with UDP broadcasts.

Send one packet to the entire network, wait for the answer from the host. Now you know the IP address of the host.

share|improve this answer
Couldn't you also use name resolution in Android? – slhck Apr 21 '12 at 10:53
I assumed the name of the target is also unknown. If the name is known, then, yes, by all means, a simple DNS query solves the problem. – Oliver Salzburg Apr 21 '12 at 10:56
Thanks, this really solves my problem. – gjackal Apr 21 '12 at 11:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .