how to close connection manually in ice?

ldr123ldr123 Member Li DongriOrganization: ownpersonProject: information monitor
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

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    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.
  • ldr123ldr123 Member Li DongriOrganization: ownpersonProject: information monitor
    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
Sign In or Register to comment.