Archived

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

server disconnected

Hi there,

Is there any notification to the client side when the server is shutdown or crashed (i.e. connection broken)?

Thanks
Alex

Comments

  • mes
    mes California
    Hi Alex,

    Whether the client becomes aware of the server's disappearance depends on several factors. If the client has no invocations pending in the server, the Ice run time in the client notices the loss of connection and logs a message, but the application itself is unaware of the situation. Ice will attempt to reestablish another connection to that server the next time the client makes an invocation.

    On the other hand, if the client has invocations pending in the server, a loss of connection may prompt the Ice run time in the client to automatically retry the invocations if possible. If the server comes back up quickly enough, or the client is using a proxy with multiple endpoints and another server is available, it's possible that the Ice run time might retry the invocation transparently (again, without the application's knowledge). However, if retrying the invocation would violate at-most-once semantics, or no other server is available, then the application can receive an exception such as ConnectionLostException that indicates the failure.

    Ice handles all aspects of connection establishment internally and attempts to make it as transparent as possible, therefore it is not a good idea to try to attach any application-specific semantics to the presence (or loss) of a connection. We recommend using the notion of a session instead. See this FAQ more information.

    Regards,
    Mark