| Author |
how to check if the website is alive or not
|
Neo Chung
Greenhorn
Joined: Feb 10, 2003
Posts: 7
|
|
hello everyone, I got a problem to see if the website is alive or not .I read the Java API about the net package but I can not find a suited method or object to solve the problem. thanks in advanced Neo
|
 |
Van Glass
Ranch Hand
Joined: Nov 18, 2000
Posts: 110
|
|
Normally you would do this using the PING command. Unfortunately Java does not support the ICMP protocol (the protocol needed to support PING). The other option is to try and open a socket connection to port 80 on the web server. Unfortunately in cases where the server is down Java will block I/O for up to several minutes before throwing an exception. To solve this problem you will probably want to open a connection to port 80 and throw an exception if the connection cannot be established within a certain period of time (e.g. 5 seconds). Take a look at the com.jscape.inet.util.TimedSocket class in iNet Factory available for download at http://www.jscape.com
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: how to check if the website is alive or not
|
|
|