[omniORB] CORBA Callback

Ivanov, Roumen Roumen.Ivanov@dresdner-bank.com
Thu, 24 Feb 2000 13:30:54 +0100


Hi Jesper,
I think you should not callback your calling object while you within =
the
server invocation.
This is going to cause something similar to dead lock situation because =
the
client stub needs to know whether the request has been processed or =
not.
Even with oneway calls you could not be safe. If you switch to SSL =
later on,
the oneway calls will turn to regular calls.

Could not say "hope this helps", because I'm not quite that this is =
what is
happening.
Regards,

	Roumen Ivanov

	Dresdner Kleinwort Benson
	GM-Middleware
	J=FCrgen-Ponto-Platz 1, 27th floor=20
	60301 Frankfurt / Main
	Tel. (+49)69/263-15293






-----Original Message-----
From:	Jesper Nordenberg [SMTP:jesper@nnl.se]
Sent:	Thursday, February 24, 2000 13:13
To:	omniorb-list@uk.research.att.com
Subject:	[omniORB] CORBA Callback

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 =3D ORB_init(argc,argv,"omniORB2");
  BOA_ptr boa =3D orb->BOA_init(argc, argv, "omniORB2_BOA");

  try {
    boa->impl_is_ready(0, 1);
...
    Channel_ptr channel =3D manager->getChannel("Channel 1"); // Obtain
channel from server
    ChannelListener_i *listener =3D new ChannelListener_i("My =
Listener");
// Create new listener
    listener->_obj_is_ready(boa); // Register it with BOA
    channel->addListener(listener);  // Call object in server
...

server, main.cpp:
-----------------

  ORB_ptr orb =3D ORB_init(argc, argv, "omniORB2");
  BOA_ptr boa =3D 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++] =3D listener;
  cout << "Listener added: " << listener->getName() << endl; // Error!
}


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

--=20
| Jesper Nordenberg, M.Sc. in C.S.E., jesper@nnl.se
| NNL Technology AB, www.nnl.se
| Phone: +46 13 211400
| Address: Teknikringen 1B, S-58330 Link=F6ping, SWEDEN