[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].&nbsp;
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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void Challenge(in long magicNumber,
out string response );
<br>};
<p>interface ServerA
<br>{
<br>&nbsp; oneway void DoSomething();
<br>};
<p>call in my client
<br>void CMyClient::DoSomething()
<br>{
<br>&nbsp;&nbsp;&nbsp; CChallengeAuthenticationImpl* pChallenge = new
<br>CChallengeAuthenticationImpl();
<p>&nbsp;&nbsp;&nbsp; m_boa->obj_is_ready(pChallenge);
<br>&nbsp;&nbsp;&nbsp; m_boa->impl_is_ready(NULL,1);
<p>&nbsp;&nbsp;&nbsp; try
<br>&nbsp;&nbsp;&nbsp; {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_server->DoSomething( pChallenge
);
<br>&nbsp;&nbsp;&nbsp; }
<br>&nbsp;&nbsp;&nbsp; catch( CORBA::SystemException&amp; ex )
<br>&nbsp;&nbsp;&nbsp; {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; ex.NP_RepositoryId()
&lt;&lt; endl;
<br>&nbsp;&nbsp;&nbsp; }
<br>&nbsp;&nbsp;&nbsp; catch( omniORB::fatalException&amp; )
<br>&nbsp;&nbsp;&nbsp; {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; "Caught a
omniORB::fatalException." &lt;&lt; endl;
<br>&nbsp;&nbsp;&nbsp; }
<br>&nbsp;&nbsp;&nbsp; catch (...)
<br>&nbsp;&nbsp;&nbsp; {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cout &lt;&lt; ""Caught a
... exception." &lt;&lt; endl;
<br>&nbsp;&nbsp;&nbsp; }
<br>}
<p>and somewhere else on a time out or somekind of end transaction
<br>{
<br>&nbsp;&nbsp; // Remove the callback object
<br>&nbsp;&nbsp; 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>--&nbsp;
| Rob Cecil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Senior Development Engineer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
| rceci@adams.com&nbsp;&nbsp;&nbsp; | Product Development&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
| (734) 913-9351&nbsp;&nbsp;&nbsp;&nbsp; | Mechanical Dynamics, Inc. (www.adams.com)&nbsp;&nbsp; |
--------------------------------------------------------------------
&nbsp;Modern Quantum Physics has found that the universe is composed of
&nbsp;25% protons, 15% electrons, 15% neutrons, and 45% morons.</pre>
&nbsp;</html>

--------------468C4355C98966274B058213--