Re: [orbitcpp-list] passing a reference to another process
Status: Beta
Brought to you by:
philipd
From: Phil D. <ph...@us...> - 2000-11-22 11:02:27
|
Hi Martin, Sorry for the late reply - I've been a bit busy recently (and it took me a couple of reads to understand this mail ;-) Martin Schulze writes: > > Hi, > > I ran into some troubles implementing a signal-slot-technology > with CORBA-objects: > > > Given three processes pA, pB, pC. > Is it possible to pass a reference retrieved in process pC from > the IOR referring to an object in the address space of pB > to process pA directly ? > Yes, you can pass the object reference as an idl argument to a corba method. You must ensure that you call the relevant reference '_duplicate' function though. (This duplicates the object reference, not the corba object implementation) e.g. for function returning a reference to interface foo: return foo::_duplicate(myfooreference); > > > In details: > > Let's say I have interfaces iA, iAA, iB, iBB. > class iA_impl contains a class iAA_impl (= oAA), > class iB_impl contains a calss iBB_impl (= oBB). > > Now I have two processes running, pA and pB. > pA has an iA_impl on the heap (= oA), pB an iB_impl (= oB). > With you so far (I think). > A third process pC is created, retrieving refences to oA and oB > through their IORs. A function of iA is called, returning a > reference to oAA and a function of iB gives a reference to oBB. > Now a function of iAA is called, giving the REFERENCE to oBB > AS its ARGUMENT. Yep - sounds okay. (must do your _duplicates though). > > Another function of oAA is called. It implicitely calls a function > of oBB - so process pA uses the reference of oBB that was > retrieved in process pC. > > => A SEGFAULT in pA occurs in the function _orb_get_connection > called by the skel of the very last function call mentioned obove. > => Bug in orbit or my design error ??? > > Unlike EJB, CORBA doesn't have any rules govening callback functions (recursive calls etc), so this should all work AFAIK. It's a little difficult to see what the problem could be without code - could you send me a copy of your idl and impl C++ files? Cheers, Phil |