[omniORB] Callback

Guy Trudel gtrudel@mediatrix.com
Thu, 11 Nov 1999 15:54:25 -0500


I'm quite new with OmniOrb so maybe that's not the 'good' way, but I just
tested callback in my evaluation yesterday.

Idl

interface ChallengeAuthentication
{
	void Challenge(in long magicNumber, out string response );
};

interface ServerA 
{
  oneway void DoSomething();
};

call in my client
void CMyClient::DoSomething()
{
    CChallengeAuthenticationImpl* pChallenge = new
CChallengeAuthenticationImpl();
   
    m_boa->obj_is_ready(pChallenge);
    m_boa->impl_is_ready(NULL,1);

    try
    {
        m_server->DoSomething( pChallenge );
    }
    catch( CORBA::SystemException& ex )
    {
        cout << ex.NP_RepositoryId() << endl;
    }
    catch( omniORB::fatalException& )
    {
        cout << "Caught a omniORB::fatalException." << endl;   
    }
    catch (...) 
    {
        cout << ""Caught a ... exception." << endl;
    }
}

and somewhere else on a time out or somekind of end transaction
{
   // Remove the callback object
   pChallenge->_dispose();
}

Just remind that with oneway keyword you can not know if your server (or
client callback) receive the request.

Guy Trudel