Archived

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

ICE doesn't correctly handle the fact of connection loss

Hello, Ice team.
Please repeat the follwoing steps:
Take your demo applications <MFC Hello world>. Run server on the one computer, run client program on the other computer. Set on the client (for example) one way invocation mode. Establish communication between the client and server programs. Then on the computer with client run TcpView from sysinternals. In TcpView mark all the connections made by the client and close them. The client program will hang. Why? Is there any workaround to avoid this situation?

Comments

  • benoit
    benoit Rennes, France
    Hi Dmitry,

    While closing TCP/IP connections to the server should be fine, you should not close the TCP/IP loopback network connection which is used internally by Ice for the thread pool implementation (see also this FAQ). Ice expects this loopback connection to remain open. Most likely this is the reason why the client mis-behaves once you close this connection.

    Cheers,
    Benoit.
  • Hello, Benoit, thank you.

    Your answer is clear. But the thing is that, in my case, i deal with kind of a specific software (it is some network trafic filter) which is on its initialization closes all tcp connections doesn't matter whether it is an Ice loopback connection or not. This leads to that my Ice component hang and the problem is that this specific filter and my Ice component must coexist together without conflicts. Is there any way to detect programmatically the fact that ICE loopback connection was broken and i must restart my Ice component or do you see any other idea to solve my problem?
  • benoit
    benoit Rennes, France
    The easiest would be to make sure the initialization of this component is done before the Ice communicator is initialized. Otherwise, I can't think of better options than destroying the communicator before the initialization of this component and re-creating it after (you will also need to re-create all the proxies your client might have created with the old communicator).

    Cheers,
    Benoit.