Archived

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

Problem about router adapter

callbackOnInterrupt();

Ice::RouterPrx pdefaultRouter= communicator()->getDefaultRouter();
if (pdefaultRouter == NULL)
{
return -1;
}
Glacier2::RouterPrx pGRouter = Glacier2::RouterPrx::checkedCast(pdefaultRouter);
if (pGRouter == NULL)
{
return -1;
}
Glacier2::SessionPrx sp;
try
{
sp = pGRouter->createSession("account","pwd");
}
catch (Glacier2::PermissionDeniedException ex)
{
}
catch (Glacier2::CannotCreateSessionException ex)
{
}
m_RouterOA = communicator()->createObjectAdapterWithRouter(
"RouterAdapter",pGRouter);

//UVSPClient::GameAgentPrx GAAgent = UVSPClient::GameAgentPrx::checkedCast(
//m_RouterOA->add(CGameInstance::getGameInst()->getGameAgent(),
//communicator()->stringToIdentity("GameAgent")));
Ice::Identity id = communicator()->stringToIdentity("GameAgent2");
Ice::ObjectPrx obj = m_RouterOA->add(new CGameAgent(),id);

m_RouterOA->activate();

UVSPClient::GameAgentPrx GAAgent = UVSPClient::GameAgentPrx::checkedCast(obj);////arise error??

This application used "router/glaciser2";
Can not use object which resides in router adapter at the same side??