Archived

This forum has been archived. Please start a new discussion on GitHub.

Server up or down?

Hello,

I would like to know what's the best way to test whether an server is up or down.
I test right now the Java ICE 2.1.2 -> C:\Ice-2.1.2\demoj\Ice\hello

How is it possible to test the server without an "exception"?
Are there any other test functionalities?

Thank a lot
surfer

Comments

  • What's wrong with an exception? You invoke an operation, such as ice_ping(), and if it throws an exception, you know that the server is in trouble. The kind of exception will give you more details about what kind of problem there is. If it is a ConnectionRefusedException, then the server is not responding, either because it is not running, or because the object adapters have not been activated. Differentiating between these two causes is impossible.
  • bernard
    bernard Jupiter, FL
    Hi Philipp,

    If you use IceGrid to start and monitor your server, you can get the status of this server with IceGrid::Admin::getServerState().

    Otherwise, for a simple server like the Hello server, the "server" as such is not visible to the client. The client just sees objects and interact with them through proxies. As a result, you can only test whether a given object is or is not reachable; for example by calling ice_ping() on a proxy to this object.

    Cheers,
    Bernard