I have extended socket and tried connecting to a host using
Socket(address, port) constructor. If the error thrown is ConnectExceptio n it means though the server is up the connection to that port is not entertained.
If an UnknownHostExce ption is thrown this simply means that the host is down/ the route is down.

This is the simplest ping simulation i could come up with. Following is the code...


...