how to implement callbacks



Ok, legal disclaimer, I am orbit-challenged.

I'm not doing any GTK gui stuff.  I have a "corba server" that provides 
functionality to a "corba client" written in Java.  The corba server is 
written in C, and uses the orbit version that's distributed with redhat 7.2.

I've been able to get java corba server programs to perform callbacks on 
java corba clients with no problems.  Basically I "register" an instance 
of my callback object with the server, and when the server needs to 
callback to the client (to do things like providing state change info) I 
just use the registered object to call the clients function.

However, I haven't had any luck with getting it to work with my C server 
using orbit.  Probably because I have no idea how.  Can somebody show me 
an example of this?  I've seen some GTK/gui examples that seem like they 
might be related to what I'm trying to do, but I don't have a learned 
enough eye to be sure.

my idl file looks like this:

module TestApp
{
     interface CallbackInterface
     {
         void DebugMessage(in string message);
	void BroadcastMessage(in string message);
     };

     interface RegistrationInterface
     {
         void RegisterClient(in CallbackInterface objRef,in string message);
	void SetVariable(in string variable);
	void SendMessage(in string message);
     };
};

With the java stuffs, I have the client call RegisterClient and pass 
over an object reference to my callback object, and then am able to call 
functions via that object.

With C, it's not looking like that'll work so well.  I've tried all 
sorts of goofy things, to no avail.

Thanks for your time, my apologies of this isn't making sense.

Mele Kalikimaka,

-Charles




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]