How can I poll a remote server, to see if it is still available?
Dear all
Please help me for that How can I poll a remote server, to see if it is still available with a specified example.
Thanks
Regards
Allena
[/URL]
Re: How can I poll a remote server, to see if it is still available?
Generally you can send a "ping" command to the server.
If you want to check if the server listens on a specific port, you need to initiates a socket connection at the specified port. Google "Java socket example" would help you.
Spring 3
Re: How can I poll a remote server, to see if it is still available?
IMO, the best way to handle remote servers is to assume they are available and handle any exceptions which may occur if they are not. It's impossible to tell if between the time you ask the server if it's still there and the time you actually want to connect if the server had somehow died. Also, it adds unnecessary overhead to every request if you're asking if it's available first.