Archived

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

Bidir connections and Ice::Blobject

I want to build a server and a client that each have a Ice::Blobject interface. However, I want to use a bidirectional connection to connect
the client to the server per the demo\Ice\bidir project.

Is this possible? I'm running into a problem where I can't do the equivalent of:

From Client.cpp
    CallbackSenderPrx server = 
        CallbackSenderPrx::checkedCast(communicator()->propertyToProxy("Callback.Client.CallbackServer"));


Because I don't have an equivalent to CallbackSenderPrx because I'm deriving form Ice::Blobject.

In the bidir sample CallbackSenderPrx is a typedef of:
typedef ::IceInternal::ProxyHandle< ::IceProxy::Demo::CallbackSender> CallbackSenderPrx;

I hope this makes sense !

Thanks,
Vince

Comments

  • mes
    mes California
    Hi Vince,

    Your ability to use a bi-directional connection is not affected by your choice of servant implementations, so it is possible to use blobject servants in this way.

    However, I'm not sure what you're asking with respect to checkedCast. Using a typed proxy, checkedCast is simply a wrapper around the ice_isA operation. You can invoke this operation using Dynamic Ice as long as you handle it correctly; specifically, the operation expects a string argument containing a type id (such as "::Demo::Callback") and returns a boolean value indicating whether the remote object supports that type.

    Hope that helps,
    Mark
  • Mark,

    Thanks for the quick response. The light finally went on.

    I guess I got too bogged down in the details to see the simplicity of the solution to my problem.

    It helps to talk :rolleyes:

    -- Vince