|
Java™ by example!
|
|
|
How do I ping a host in JDK1.5?
JDK1.5 provides the functionality to test the reachability of a host. Before JDK 1.5, you had to implement this yourself (for example by sending UDP packets to the echo port (7) of the target machine). Actually, the strategy of the implementation of isReachable is to try to use ICMP if it is available, or else to try to connect to the echo port. This example shows you how the test the reachability of a host:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|