[omniORB] CORBA Callback

Stefan Seefeld seefelds@MAGELLAN.UMontreal.CA
Thu, 24 Feb 2000 08:41:51 -0500


Jesper Nordenberg wrote:
> 
> I'm having some problems calling an object created by a client from the
> server. The code looks like this:
> 
> client, main.cpp:
> -----------------
> 
>   ORB_ptr orb = ORB_init(argc,argv,"omniORB2");
>   BOA_ptr boa = orb->BOA_init(argc, argv, "omniORB2_BOA");
> 
>   try {
>     boa->impl_is_ready(0, 1);
> ...
>     Channel_ptr channel = manager->getChannel("Channel 1"); // Obtain
> channel from server
>     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

you mean

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

> ...
> 
> server, main.cpp:
> -----------------
> 
>   ORB_ptr orb = ORB_init(argc, argv, "omniORB2");
>   BOA_ptr boa = orb->BOA_init(argc, argv, "omniORB2_BOA");
> ...
>   boa->impl_is_ready();
> 
> server, Channel_i.cpp:
> ----------------------
> 
> void Channel_i::addListener(ChannelListener_ptr listener) {
>   cout << "Adding listener" << endl;
>   listeners[listenerCount++] = listener;
>   cout << "Listener added: " << listener->getName() << endl; // Error!
> }

Regards,	Stefan

_______________________________________________________              
              
Stefan Seefeld
Departement de Physique
Universite de Montreal
email: seefelds@magellan.umontreal.ca

_______________________________________________________

      ...ich hab' noch einen Koffer in Berlin...