[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-user
Subject:    Re: Common IDL ?
From:       ano265 () TCC ! thomson ! fr
Date:       1998-07-30 7:25:00
[Download RAW message or body]

Timothy wrote :
> The second question is regarding the methods.  Does MICO provide an
> interface for the server to generate events on the client?

I don't know if MICO can do it 'coz I wasn't able to compile MICO on my linux box \
(only 24 Mo RAM :-(  ! ).

What I know is that MICO is said to be CORBA 2.0 compliant and that you can a way for \
a server to call methods on a client.

I've done this with Visibroker under Windows during a one week CORBA courses.

To do this, you implement an interface in IDL _on your client_ :
interface MyClientInterface
	DoSomethingOnClient(void)

On the server, you have an interface to register your client interface
interface MyServerInterface
	RegisterClientInterface(MyClientInterface *)
	DoSomethingOnServer(void)

The client, in order to act as a CORBA server, must implement a message loop.
MyClientInterface::DoSomethingOnClient(void)
{
	cout << "Hello from a client " << endl;
}

ClientThread(void)
{
// ...
 Impl_Is_Ready();
// ...
}

void main(void)
{
	Boa_Init();
	// Register the MyClientInterface
	// Create and start the ClientThread
	// Use a service of the server
	// ...
	pServerInterface->DoSomethingOnServer();
	// Wait for a key ...
}

The server do the same:
MyServerInterface::RegisterClientInterface(MyClientInterface *p)
{
	m_pClientInterface = p;
}

MyServerInterface::DoSomethingOnServer(void)
{
	// if condition ...
	m_pClientInterface->DoSomethingOnClient();
	// ...
}

void main(void)
{
	Boa_Init();
	// Register the MyServerInterface
	Impl_Is_Ready();
}

Now, you build both the client and the server.
You start for example the client, this last causes the starting of the server.
The client use the DoSomethingOnServer()  method that will under some conditions \
starts the DoSomethingOnClient() method on the client.

Although the above is _warranted_ not to compile :-), I can say it worked this way.

Hope that helps.

See you for more CORBA chat !
______________________
Sebastien BROCHET
ano266@tcc.thomson.fr

================================================================================
                     +++ the KDE user mailing list +++
To unsubscribe from this list send mail to kde-user-request@kde.org with the 
                         **Subject** unsubscribe. 
================================================================================


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic