Archived

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

Ice.Override.Timeout / ice_timeout()

Hi,

Ice 2.1.1
MSVC++ 7.1 & Python 2.4 (tested in both language mappings)

I have a doubt concerning proxy's timeout and its configuration.

In Ice 2.1.1 Manual (page 743):
"The Ice run time provides the Ice.Override.Timeout property (see Appendix C). This property allows you to replace the default timeout value of -1 (no timeout) with a different value. Setting this property affects all proxies for which you have not otherwise set a timeout with ice_timeout."

In my config file I set Ice.Override.Timeout=2000 and all proxies works with this timeout value (2 secs) ok. But, I have one special proxy that must be configured with another timeout value (500 msecs).

I do proxy = proxy->ice_timeout(500) but this doesn't work. It still works with the value of Ice.Override.Timeout (2 secs), not 500 msecs.

If I don't define Ice.Override.Timeout in my config file, 500 msecs are used with this proxy so it works as expected. Of course, without this property all the rest proxies work without timeout (-1).

This is the expected behavior?

Thank you very much,
Mario

Comments

  • marc
    marc Florida
    Yes, Ice.Override.Timeout overrides all timeout settings. It is not a default value, it is an override value. It is typically used to test an application with timeout values other than the hardcoded ones.

    In general, you should set timeout values as part of your object adapter's endpoint configuration. Proxies created by this object adapter will then automatically have this timeout value. For example:

    MyObjectAdapter.Endpoints=default -p 10000 -t 10000

    With this configuration, all proxies created by the object adapter will have a timeout of 10s. Of course, you can use Ice.Override.Timeout also on the server to override the configured endpoint timeouts.
  • Thanks for your quick reply, Marc! :-)

    I misunderstand the meaning of this property, now is clear to me.

    Maybe a definable default timeout value will be a good thing, that can be overrided with "-t xxx" or ice_timeout().

    Thanks again for your help, Marc!
  • Default vs override

    May be I'm wrong but Ice documentation (3.1.0.pdf) mentions default values if ice_timeout is not set for a proxy. Anyway it really worth to have possibility to change default values besides overriding them.

    p. 842
    If no timeout is established for a proxy via ice_timeout, the Ice run time uses default values that you can change with the following configuration properties:
    • Ice.Override.ConnectTimeout