[omniORB] Callback

Theo Aukerman taukerman@logici.com
Thu, 11 Nov 1999 13:04:28 -0800


That's what I was afraid of regarding one-way semantics.

-----Original Message-----
From: Rob Cecil [mailto:rceci@master.adams.com]
Sent: Thursday, November 11, 1999 12:56 PM
To: Guy Trudel
Cc: Omniorb-List (E-mail); 'Renny Koshy'
Subject: Re: [omniORB] Callback


The Corba spec does not guarantee non-blocking behavior or asynch call
dispatch. 

Read p. 96 of Advanced Corba Programming with C++ [Henning/Vinoski].  They
recommend avoid oneways completely. 


Perhaps you need to look at the Event service as an alternative to
callbacks? 


Rob 


Guy Trudel wrote: 


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

-- 

| Rob Cecil          | Senior Development Engineer                 |

| rceci@adams.com    | Product Development                         |

| (734) 913-9351     | Mechanical Dynamics, Inc. (www.adams.com)   |

--------------------------------------------------------------------

 Modern Quantum Physics has found that the universe is composed of

 25% protons, 15% electrons, 15% neutrons, and 45% morons.