Home Help Center

How to disable Ice's reestablish-connection behavior ?

rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
This is the requirement: If a proxy really established a connection to the server and then at some time the connection is broken, the proxy does not reestablish the connection in all later operation calls. Suppose we have configured: Ice.RetryIntervals=-1.

That is:
ObjectPrx proxy = ...;          //timeA: get a proxy at timeA
proxy.ping();                      //timeB: really establish the connection

...                                    //timeC: the connection is broken for some reason

proxy.ping();		//timeD: 
proxy.ping();		//timeE:
proxy.ping();		//timeF:

we want the operations at timeD/E/F all fail and don't try to reestablish a connection to the server.

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    You could use a fixed connection proxy:
    ObjectPrx proxy = ...;          //timeA: get a proxy at timeA
    proxy.ping();                      //timeB: really establish the connection
    
    proxy = proxy.getConnection().createProxy(proxy.getIdentity());
    
    ...                                    //timeC: the connection is broken for some reason
    
    proxy.ping();		//timeD: 
    proxy.ping();		//timeE:
    proxy.ping();		//timeF:
    
  • rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
    Great! Thank you!

    By the way, it should be:
    ...
    proxy = proxy.ice_getConnection().createProxy(proxy.ice_getIdentity());
    ...
    
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    I'm glad that I could help. As an aside, can you please update your signature with the name of your organization and the project you are working on? Please see this post for details.
  • rc_hzrc_hz Member Eric RCOrganization: www.genband.comProject: No project yet ✭✭✭
    Thank you, Marc. I like Ice very much and now just study and evaluate it(Ice for C++, Ice for Java, Ice for Python). Until now, I have no chance to put Ice into practical use because my company just uses corba and Tuxedo. It's a sorrow for me!
Sign In or Register to comment.