Hi!
When I invoke an AMI operation using a proxy that is configured to use collocation optionzation and the servant is collocated, but Ice run time doesn't raises CollocationOptimizationException and the invocatkon doesn't work.
I saw that CollocationOptimizationException would be raised in this case in Ice manual.
My code:
The servant whose object adapter was created by the same communicator as the proxy.Code:... ... while (true) { try { prx->begin_sayHello (); std::cout << "success asyn invoke- "; break; } catch (const Ice::CollocationOptimizationException &) { prx = prx->ice_collocationOptimized(false); std::cout << "Failed asyn invoke, off collocation optimized." << std::endl; } } ... ...
But invocation begin_sayHello doesn't work ("success asyn invoke- " is outputted) and no Ice::CollocationOptimizationException is rasied.
There is another code I modified, It works well, I catch CollocationOptimizationException and the invocation begin_sayHello does work.
I'm confused why the first doesn't work!Code:... ... try { prx = ice_getConnection (); } catch (const Ice::CollocationOptimizationException &) { prx = prx-ice_collocationOptimized(false); std::cout << "catch Ice CollocationOptimizationException." << std::endl; } prx->begin_sayHello (); ... ...
Here is my whole test code.
My os is Red Hat Enterprise Linux Server release 5.

Reply With Quote