Archived

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

how to close connection manually in ice?

I'm studying ICE recently. Now I have some questions.
If I want to close a connection between Server and Client, I can use the config file to set it.(For example, If I set Ice.ACM.Server = n or Ice.ACM.Client = n), the connection will be automatically closed by the server or client after they have been idle for n seconds.But now, I want to close connection manually(The code like "m_Conn->Close()"), How do it?Please give me some suggestions to resolve it. thanks a lot.

Best Regards
Li Dongri

Comments

  • matthew
    matthew NL, Canada
    You can call ice_getConnection(), or ice_getCachedConnection(). That returns an Ice::Connection object (see slice/Ice/Connection.ice). That can then be closed by calling close(true), or close(false) on the connection object. There should be more documentation on this in the Ice manual.
  • matthew wrote: »
    You can call ice_getConnection(), or ice_getCachedConnection(). That returns an Ice::Connection object (see slice/Ice/Connection.ice). That can then be closed by calling close(true), or close(false) on the connection object. There should be more documentation on this in the Ice manual.
    ----
    Hi matthew
    Thanks for you reply, i will try it.

    Best regards.
    Li dongri