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?

Thanks
Alex

Comments

  • 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);
    newProxy.sayHello();
    
    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,
    Mark
  • 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.

    Cheers,

    Michi.
Sign In or Register to comment.