[omniORB] Callback
Rob Cecil
rceci@master.adams.com
Thu, 11 Nov 1999 15:56:07 -0500
--------------468C4355C98966274B058213
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
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.
--------------468C4355C98966274B058213
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
The Corba spec does not guarantee non-blocking behavior or asynch call
dispatch.
<p>Read p. 96 of Advanced Corba Programming with C++ [Henning/Vinoski].
They recommend avoid oneways completely.
<p>Perhaps you need to look at the Event service as an alternative to callbacks?
<p>Rob
<p>Guy Trudel wrote:
<blockquote TYPE=CITE>I'm quite new with OmniOrb so maybe that's not the
'good' way, but I just
<br>tested callback in my evaluation yesterday.
<p>Idl
<p>interface ChallengeAuthentication
<br>{
<br> void Challenge(in long magicNumber,
out string response );
<br>};
<p>interface ServerA
<br>{
<br> oneway void DoSomething();
<br>};
<p>call in my client
<br>void CMyClient::DoSomething()
<br>{
<br> CChallengeAuthenticationImpl* pChallenge = new
<br>CChallengeAuthenticationImpl();
<p> m_boa->obj_is_ready(pChallenge);
<br> m_boa->impl_is_ready(NULL,1);
<p> try
<br> {
<br> m_server->DoSomething( pChallenge
);
<br> }
<br> catch( CORBA::SystemException& ex )
<br> {
<br> cout << ex.NP_RepositoryId()
<< endl;
<br> }
<br> catch( omniORB::fatalException& )
<br> {
<br> cout << "Caught a
omniORB::fatalException." << endl;
<br> }
<br> catch (...)
<br> {
<br> cout << ""Caught a
... exception." << endl;
<br> }
<br>}
<p>and somewhere else on a time out or somekind of end transaction
<br>{
<br> // Remove the callback object
<br> pChallenge->_dispose();
<br>}
<p>Just remind that with oneway keyword you can not know if your server
(or
<br>client callback) receive the request.
<p>Guy Trudel</blockquote>
<pre>--
| 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.</pre>
</html>
--------------468C4355C98966274B058213--