[omniORB] CORBA Callback

Duncan Grisby dgrisby@uk.research.att.com
Thu, 24 Feb 2000 14:34:05 +0000


On Thursday 24 February, Jesper Nordenberg wrote:

Contrary to what one poster has suggested, you can do what you are
attempting to do, and call a call-back from within an operation
invocation.

[...]

>     ChannelListener_i *listener = new ChannelListener_i("My Listener");
> // Create new listener
>     listener->_obj_is_ready(boa); // Register it with BOA
>     channel->addListener(listener);  // Call object in server

This will work with omniORB 2, but you should say

  channel->addListener(listener->_this());

The version without the _this() will cause a compile-time error on
some ORBs, including omniORB 3.

[...]
> It works ok until "listener->getName()" is called, then the client
> exists with a segmentation fault. What am I doing wrong?

I can't see anything wrong with the code you showed, other than the
minor point about _this(). Have you correctly implemented the
getName() operation?

Try running the client in a debugger, and see exactly where it dies.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --