I recently came across two methods for checking whether a ip-address is reachable or not:
1) Using java.net.Socket 2) Using java.net.InetAddress
Using (1), opens a TCP connection at port 80, whereas using (2) would typically use ICMP echo requests (if permitted by the server) or open a TCP connection on port 7.
Which of these two methods would be fast? I have a number of servers to ping from my java code, so how would I go about doing that?
Any help would be appreciated!