Home Help Center

Server up or down?

surfersurfer Member ✭✭

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


  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    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.
  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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.

Sign In or Register to comment.