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

Question about "Ice.MonitorConnections"

hi, there,
In the 39.3.4 , the manual said: For clients that use AMI, we set Ice.MonitorConnections so that AMI
timeouts operate correctly.
I can not understand it very well. Could you pleas give me more explainations about it?



  • mes
    mes California

    When you invoke a synchronous operation with a timeout, the Ice run time is able to use the application's thread to block for the specified amount of time and then raise TimeoutException if necessary.

    This isn't possible when you invoke an operation asynchronously, because the application's thread doesn't block in the Ice run time. Therefore, if you want your AMI callback object to be notified about a timeout, the Ice run time must use a separate thread that periodically checks the pending requests to see if any of them have timed out. If a timeout occurs, the Ice run time notifies the AMI callback by invoking its ice_exception method with a TimeoutException argument. The Ice.MonitorConnections property determines how frequently this dedicated thread checks the pending requests for timeouts. This thread is also responsible for closing inactive connections, which is where the property derived its name.

    Hope that helps,
    - Mark
  • So good. Thank you very much.