I want my program to check if a login server is online, and if so, launch a program.
I have the login server's IP address, so all I need is a way to check if it's online/available.
Thanks for any help! :D:
Printable View
I want my program to check if a login server is online, and if so, launch a program.
I have the login server's IP address, so all I need is a way to check if it's online/available.
Thanks for any help! :D:
ping <ip-address>
I tried this method Learn Java by Examples - How do I ping a host?
But InetAddress seemed to return a false result (It said the IP address wasnt reachable, although I'm 100% sure it is).
Are there any other methods?
This might explain why it is not working:
How to do a true Java ping from Windows? - Stack Overflow
A couple of ideas here:
Ping Class java
...including running the PING program.
From what I've read "Ping"-ing in Java is not that good, so I'm going to have to do the ping test in C++, then some how call it in Java.. no idea how to do this though :(-: Can someone maybe lead me to a tutorial on how I'd do this?
You'd use the Java Native Interface (JNI).
JDK 5.0 Java Native Interface-related APIs & Developer Guides -- from Sun Microsystems
It's tricky.
Best of luck!