0

Recently, I created a client/server application by java, they connect is fine, but when i test it in my school network, it can not work fine anymore, so, i need some code that return all IP of Lan network into an array so that i can put it in a JComboBox, the code should be non-blocking so it cannot hang my application.

P/S: I have been try brute-force method (like other answer) to get all IPs but it just hang my application and really not reliable.

Anyway, thank for your help.

~Best Regard and have a nice day

  • Do you mean all IPs actually assigned to computers or just all IPs within your subnet? Because the latter is a simple computation, the former needs network scanning with tools like nmap or something like that. What exactly is the problem in your system, what do you want to use the IPs for? Maybe there is a way around your problem. – G. Bach Mar 27 '12 at 17:26

1 Answers1

0

it can not work fine anymore, so, i need some code that return all IP of Lan network into an array so that i can put it in a JComboBox

Why would you need these IPs????

Problem could be:
Either you bind to localhost and when you deploy in different machines you can't connect. So don't bind to localhost.
Or there is a firewall. So unblock the firewall.
Or there is no route between the machines. Can you even ping it? (but if there is a firewall it will not ping also).
So you can troubleshoot it.

Cratylus
  • 52,998
  • 69
  • 209
  • 339