Archived

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

Program delayed in ICE-Grid, Help!

Hi, I have writen a Program used ICE Grid . The Program contains an ICE grid with two grid nodes, they are two ICE Server. They running on Redhat Linux AS 4 OS. The ICE version is 3.1.1. But, when remote ICE Clients are firing requests to any of the two ICE Server, the time it takes to connect to server is either immediate or 20 seconds.:(

In the code,I get two places where will delay the program running.
The first is connect to icegrid.The codes as follows:
_________________________________________________________________

Ice.Properties pro = Ice.Util.createProperties();
pro.load(configFile);

ic = Ice.Util.initializeWithProperties(new String[0], pro);
Ice.ObjectAdapter adapter = ic.createObjectAdapter("clientAdapter");
ClientReceiverI object = new ClientReceiverI();
Ice.ObjectPrx base = adapter.add(object, Ice.Util.stringToIdentity("cObject"));
adapter.activate();
_________________________________________________________________


When running to "adapter.activate();", it will delay about 20 seconds.



The second is get ICE object.The codes as follows:
_________________________________________________________________
try{
Ice.ObjectPrx base = ic.stringToProxy("IceGrid/Query");
IceGrid.QueryPrx query = IceGrid.QueryPrxHelper.checkedCast(base);
IDSPrxs = query.findAllObjectsByType("TeleControl");
System.out.println("IDSPrxs.length="+IDSPrxs.length);
}catch(Ice.LocalException e){
e.printStackTrace();
}catch(Exception e){
e.printStackTrace();
}

TeleControlPrxMap.clear();
if(IDSPrxs != null && IDSPrxs.length > 0){
try{
for(int i = 0 ; i < IDSPrxs.length; i++){
proxyVector.addElement(IDSPrxs);

TeleControlPrx proxy = TeleControlPrxHelper.checkedCast(IDSPrxs);
String prxIP = proxy.getProxyIP();
IPVector.addElement(prxIP);
TeleControlPrxMap.put(prxIP, proxy);
}
}catch(Exception e){
e.printStackTrace();
}
}
_________________________________________________________________


When running to "TeleControlPrx proxy = TeleControlPrxHelper.checkedCast(IDSPrxs);" ,will delay about from 20 second to 5 minutes.

I debug the code ,track the runing into "TeleControlPrxHelper.checkedCast",I see it will delay in the code like this:
_________________________________________________________________

__obj.ice_isA("::com::wiscom::IDSConsoleProxy::TeleControl");
_________________________________________________________________


The Class of the instance "__obj" is "ICE.ObjectPrx".

I can't resolve this questions, and I don't know the reason of the delay.

I have troubled with this problem for several weeks, Please Help me ,very thanks!!!

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Could you upgrade to Ice 3.2.1 and see if the problem still occurs? (note that we only provide free support on the forums for the latest Ice version.)

    Cheers,
    Benoit.
  • Are you endpoints valid? Are you having to do DNS lookups? When I've run into this before it's because either the endpoints that I was connecting to weren't routable from where I was connecting from, or that my system was doing DNS lookups on internal addresses that weren't defined in the DNS and it was taking a long time to resolve.
  • Thanks

    Thanks!

    To Benoit:
    Can you tell me, is there anybody else comes to this problem?

    To Ctennis:
    I use IP in all of my properties files, so I think it's not about the DNS.

    Cheers,
    Shen Hongzhou.