Home Help Center

obtaining a proxy for "this" in a servant

vukicevicvukicevic Member Vladimir VukicevicOrganization: DUGProject: DUG Insight ✭✭
Within a servant implementation, is there a canonical way for obtaining a Proxy for "this", so that one can pass it to remote method for callback purposes?

I've currently been using the following, which seems to do the right thing..
void
FooI::doFoo(const Ice::Current& c)
{
    FooPrx thisPrx = FooPrx::uncheckedCast(c.adapter->createProxy(c.id));

    ...
}

Can I safely cache thisPrx, assuming I only add the servant to one adapter? In the multiple adapter case, can I store a per-adapter cached Prx?

Thanks in advance for any information!

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    As long as your servant only implements one single Ice object, and you use it only with one object adapter, you can cache thisPrx.
Sign In or Register to comment.