Hi there!
I've been struggling with the IcePack manual server registration for two days now and I'm no longer sure if this is due to incompetence (most likely) - documentation on that issue is, errr, challenging, to say the least.
So, here's the problem. I want do do indirect binding between a client and a collection of similar objects distributed in a network. The server registers with
The client (in its simplest form, just to show the issue) does this:Code:LoadFetcher* theFetcher=new LoadFetcher(); IceUtil::ThreadControl tc=theFetcher->start(); Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("AgentAdapter"); Ice::ObjectPtr object = new AgentI(*theFetcher); Ice::ObjectPrx objPrx = adapter->add(object, Ice::stringToIdentity(IceUtil::generateUUID())); IcePack::AdminPrx admin = IcePack::AdminPrx::checkedCast(communicator()->stringToProxy("IcePack/Admin")); admin->addObjectWithType(objPrx, object->ice_id()); cout << "Press Ctrl-C to terminate." << endl; adapter->activate();
When I register the first server and then fetch its identity via IcePackAdmin, everything works like a charm:Code:ic = Ice::initializeWithProperties(argc, argv, properties); Ice::ObjectPrx base = ic->stringToProxy(argv[1]); CpuMonitor::AgentPrx agent = CpuMonitor::AgentPrx::checkedCast(base); cout << "CPU Load for agent is " << agent->fetchCpuLoad() << endl;
bash$ direct-client 10A5509D-819D-4371-970D-C01105D5284D
Contacting CPU Load server...
[ Location: retrieved endpoints from locator, adding to locator table
adapter =
endpoints = tcp -h 192.168.1.1 -p 12000 ]
[ Location: retrieved endpoints from locator, adding to locator table
adapter = AgentAdapter
endpoints = tcp -h 192.168.1.1 -p 9593 ]
CPU Load for agent is 0.99
bash$
But when I register a second server, the whole machinery seems to get out of sync. Ignoring which of the two IDs I use as direct-client argument, the output is either the load of the second server or the following:
Contacting CPU Load server...
[ Location: retrieved endpoints from locator, adding to locator table
adapter =
endpoints = tcp -h 192.168.1.1 -p 12000 ]
[ Location: retrieved endpoints from locator, adding to locator table
adapter = AgentAdapter
endpoints = tcp -h 192.168.1.1 -p 9593 ]
Outgoing.cpp:348: Ice::ObjectNotExistException:
object does not exist
identity: 280E2AA5-96C6-4C81-948A-7AC679B50CBF
facet:
operation: ice_isA
Do it another one, two or three times and you're back at the second server's load, just as if IcePack has a bookkeeping problem ?!
Anyone an idea?
Cheers,
Mobi.

Reply With Quote