Home Help Center

how to set timeout for each call?

alexnycheungalexnycheung Member Alex CheungOrganization: CGIProject: Management Node Middleware
Hi there,

I know how to set the connection timeout in the proxy string (i.e. -t parameter); how about each Ice method call? Can I set different timeout value for different calls? So that some calls can have longer timeout but some shorter?



  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi Alex,

    You can use a different timeout for each remote invocation, but you'll need to create a new proxy using ice_timeout:
    int newTimeout = ...;
    HelloPrx newProxy = (HelloPrx)oldProxy.ice_timeout(newTimeout);
    Note that Ice creates a new connection to the server for each unique endpoint-timeout combination. Remember also that timeouts affect all pending invocations on the same connection.

    Hope that helps,
  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    You can call ice_timeout on a proxy to create a new proxy with a different timeout. Note that the Ice run time uses a separate connection for each distinct timeout value, so you should avoid having dozens or more different timeout values, unless you are willing to use that many connections.


Sign In or Register to comment.