diff options
author | mk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-07-22 17:30:31 +0000 |
---|---|---|
committer | mk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-07-22 17:30:31 +0000 |
commit | 34aa37da43c9b64c53d21d970a7cdc4c601c858c (patch) | |
tree | d217b4cdd70544b8ab5645e476a6ac42c0d1871e | |
parent | ff4a638fdb99283cb5a736d4eedf07c5aa1229c8 (diff) | |
download | ATCD-34aa37da43c9b64c53d21d970a7cdc4c601c858c.tar.gz |
ChangeLogTag: Sun Jul 20 12:30:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 11 | ||||
-rw-r--r-- | TAO/tao/Asynch_Invocation.cpp | 56 | ||||
-rw-r--r-- | TAO/tao/Asynch_Invocation.i | 26 |
3 files changed, 62 insertions, 31 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 1067aed0f1d..64c75949b12 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,14 @@ +Sun Jul 20 12:30:00 2001 Michael Kircher <Michael.Kircher@mchp.siemens.de> + + * tao/Asynch_Invocation.cpp: + * tao/Asynch_Invocation.i: + + Changed the code which sets up a reply dispatcher for + AMI calls to only set up one, if a non-nil reply handler + got registerd. This change is related to my change on + Fri Jul 20 08:10:00 2001. It assumes that the ORB + will drop replies to which no reply dispatcher is registered. + Sun Jul 22 09:43:09 2001 Balachandran Natarajan <bala@cs.wustl.edu> * tests/Big_Reply/Test.idl: Added a no-op ping () operation which diff --git a/TAO/tao/Asynch_Invocation.cpp b/TAO/tao/Asynch_Invocation.cpp index eec74ba8c59..d36f84ba290 100644 --- a/TAO/tao/Asynch_Invocation.cpp +++ b/TAO/tao/Asynch_Invocation.cpp @@ -82,36 +82,48 @@ int TAO_GIOP_Twoway_Asynch_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - // Register a reply dispatcher for this Asynch_Invocation. Use the - // heap allocated reply dispatcher. + int retval = 0; - int retval = - this->transport_->tms ()->bind_dispatcher (this->op_details_.request_id (), - this->rd_); - if (retval == -1) + // Only do the following steps if we have a valid reply dispatcher installed. + // In cases where no reply handler got installed, no reply dispatcher will + // have been set up. The ORB will drop replies to which it cannot associate + // a reply dispatcher. + + if (this->rd_) { - // @@ What is the right way to handle this error? - this->close_connection (); - ACE_THROW_RETURN (CORBA::INTERNAL (TAO_DEFAULT_MINOR_CODE, - CORBA::COMPLETED_NO), - TAO_INVOKE_EXCEPTION); - } + // Register a reply dispatcher for this Asynch_Invocation. Use the + // heap allocated reply dispatcher. - // Lets remember the transport for later, so that we can idle the transport - // when the reply dispatcher goes away. - this->rd_->transport (this->transport_); + retval = + this->transport_->tms ()->bind_dispatcher (this->op_details_.request_id (), + this->rd_); + if (retval == -1) + { + // @@ What is the right way to handle this error? + this->close_connection (); + ACE_THROW_RETURN (CORBA::INTERNAL (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_NO), + TAO_INVOKE_EXCEPTION); + } - // AMI Timeout Handling Begin + // Lets remember the transport for later, so that we can idle the transport + // when the reply dispatcher goes away. + this->rd_->transport (this->transport_); - if (this->max_wait_time_ != 0) - { - this->rd_->schedule_timer (this->op_details_.request_id (), - *this->max_wait_time_); - } - // AMI Timeout Handling End + // AMI Timeout Handling Begin + + if (this->max_wait_time_ != 0) + { + this->rd_->schedule_timer (this->op_details_.request_id (), + *this->max_wait_time_); + } + + // AMI Timeout Handling End + + } // if (this->rd_) // Just send the request, without trying to wait for the reply. retval = TAO_GIOP_Invocation::invoke (0, diff --git a/TAO/tao/Asynch_Invocation.i b/TAO/tao/Asynch_Invocation.i index 657dd6675af..3b282d42c5f 100644 --- a/TAO/tao/Asynch_Invocation.i +++ b/TAO/tao/Asynch_Invocation.i @@ -42,15 +42,23 @@ TAO_GIOP_Twoway_Asynch_Invocation::TAO_GIOP_Twoway_Asynch_Invocation ( argument_flag, orb_core) { - // New reply dispatcher on the heap, because - // we will go out of scope and hand over the - // reply dispatcher to the ORB. - // So this->rd_ is 0, because we do not need to - // hold a pointer to it. - ACE_NEW (this->rd_, - TAO_Asynch_Reply_Dispatcher (reply_handler_skel, - reply_handler_ptr, - orb_core)); + // If the reply handler is nil, we do not create a reply dispatcher. + // The ORB will drop replies to which it cannot associate a reply + // dispatcher. + if (!CORBA::is_nil (reply_handler_ptr)) + { + // New reply dispatcher on the heap, because + // we will go out of scope and hand over the + // reply dispatcher to the ORB. + + // @@Michael: What does following comment mean? + // So this->rd_ is 0, because we do not need to + // hold a pointer to it. + ACE_NEW (this->rd_, + TAO_Asynch_Reply_Dispatcher (reply_handler_skel, + reply_handler_ptr, + orb_core)); + } } #endif /* (TAO_HAS_AMI_CALLBACK == 1) || (TAO_HAS_AMI_POLLER == 1) == 0 */ |