diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-02-11 20:10:22 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-02-11 20:10:22 +0000 |
commit | b1a7f951965300404bd1a6b21d2ba3c98291b6d9 (patch) | |
tree | 869b6b84b41a3ed1c75dd2ec49366d405fdb23ff | |
parent | 2347c840e0e9faeae9671dac0942a7b5bf0383c8 (diff) | |
download | ATCD-b1a7f951965300404bd1a6b21d2ba3c98291b6d9.tar.gz |
ChangeLogTag: Mon Feb 11 14:03:18 2002 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | TAO/tao/ChangeLog | 20 | ||||
-rw-r--r-- | TAO/tao/Exclusive_TMS.cpp | 18 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/Invocation.cpp | 10 | ||||
-rw-r--r-- | TAO/tao/Muxed_TMS.cpp | 27 | ||||
-rw-r--r-- | TAO/tao/Muxed_TMS.h | 13 | ||||
-rw-r--r-- | TAO/tao/Transport.h | 4 |
7 files changed, 73 insertions, 28 deletions
diff --git a/TAO/tao/ChangeLog b/TAO/tao/ChangeLog index 1b94ce800d9..515cd9c5767 100644 --- a/TAO/tao/ChangeLog +++ b/TAO/tao/ChangeLog @@ -1,3 +1,23 @@ +Mon Feb 11 14:03:18 2002 Balachandran Natarajan <bala@cs.wustl.edu> + + * tao/Transport.h: Removed the virtual declaration from the method + bidirectional_flag (). It shouldnt have been virtual to start + with. + + * tao/Muxed_TMS.h: Removed some old comments + + * tao/Muxed_TMS.cpp (request_id): + * tao/Exclusive_TMS.cpp: Added a condition within request_id + (). The request_id that is generated will obey BiDirGIOP rules, + ie. the originator will send even number requests and the + receiver send odd numbered requests. The old method of + generation was giving problems in MT cases. + + * tao/Invocation.cpp: Minor cosmetic changes. + * tao/IIOP_Transport.cpp: Modify the request id only for the first + request during BiDir connection origination. + + Thu Jan 31 11:23:59 2002 Balachandran Natarajan <bala@cs.wustl.edu> * tao/Cache_Entries.cpp: Did a cosmetic fix. diff --git a/TAO/tao/Exclusive_TMS.cpp b/TAO/tao/Exclusive_TMS.cpp index 95cd9d1bd09..0f17f8eddca 100644 --- a/TAO/tao/Exclusive_TMS.cpp +++ b/TAO/tao/Exclusive_TMS.cpp @@ -27,11 +27,27 @@ TAO_Exclusive_TMS::~TAO_Exclusive_TMS (void) CORBA::ULong TAO_Exclusive_TMS::request_id (void) { + this->request_id_generator_++; + + // if TAO_Transport::bidirectional_flag_ + // == 1 --> originating side + // == 0 --> other side + // == -1 --> no bi-directional connection was negotiated + // The originating side must have an even request ID, and the other + // side must have an odd request ID. Make sure that is the case. + int bidir_flag = + this->transport_->bidirectional_flag (); + + if ((bidir_flag == 1 && ACE_ODD (this->request_id_generator_)) + || (bidir_flag == 0 && ACE_EVEN (this->request_id_generator_))) + ++this->request_id_generator_; + if (TAO_debug_level > 4) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) TAO_Exclusive_TMS::request_id - <%d>\n"), this->request_id_generator_)); - return this->request_id_generator_++; + + return this->request_id_generator_; } // Bind the handler with the request id. diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index 56eac4cc260..71d6292073d 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -214,11 +214,12 @@ TAO_IIOP_Transport::generate_request_header (TAO_Operation_Details &opdetails, // Set the flag to 0 (i.e., originating side) this->bidirectional_flag (0); - } - // Modify the request id if we have BiDirectional client/server - // setup - opdetails.modify_request_id (this->bidirectional_flag ()); + // Modify the request id if we have BiDirectional client/server + // setup. + // @@ Is this needed at all? + opdetails.modify_request_id (this->bidirectional_flag ()); + } return TAO_Transport::generate_request_header (opdetails, diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index 5623bb81f82..99e91175937 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -207,7 +207,7 @@ TAO_GIOP_Invocation::start (TAO_ENV_SINGLE_ARG_DECL) this->countdown_ = &countdown; this->endpoint_selector_->select_endpoint (this - TAO_ENV_ARG_PARAMETER); + TAO_ENV_ARG_PARAMETER); ACE_CHECK; // Set the unique request ID associated with this request. @@ -311,7 +311,7 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags ACE_CHECK; // Set the target specification mode - switch (this->profile_->addressing_mode ()) + switch (this->profile_->addressing_mode ()) { case TAO_Target_Specification::Key_Addr: this->target_spec_.target_specifier ( @@ -333,7 +333,7 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags IOP::IOR *ior_info = 0; int retval = this->stub_->create_ior_info (ior_info, index - TAO_ENV_ARG_PARAMETER); + TAO_ENV_ARG_PARAMETER); ACE_CHECK; if (retval == -1) @@ -564,8 +564,8 @@ TAO_GIOP_Synch_Invocation::invoke_i (CORBA::Boolean is_locate_request // preallocated reply dispatcher. // Bind. - - TAO_Transport_Mux_Strategy *tms = this->transport_->tms (); + TAO_Transport_Mux_Strategy *tms = + this->transport_->tms (); TAO_Bind_Dispatcher_Guard dispatch_guard ( this->op_details_.request_id (), diff --git a/TAO/tao/Muxed_TMS.cpp b/TAO/tao/Muxed_TMS.cpp index fb73ccba938..88d7207d0e7 100644 --- a/TAO/tao/Muxed_TMS.cpp +++ b/TAO/tao/Muxed_TMS.cpp @@ -30,7 +30,28 @@ TAO_Muxed_TMS::request_id (void) // @@ What is a good error return value? ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0); - return this->request_id_generator_++; + + ++this->request_id_generator_; + + // if TAO_Transport::bidirectional_flag_ + // == 1 --> originating side + // == 0 --> other side + // == -1 --> no bi-directional connection was negotiated + // The originating side must have an even request ID, and the other + // side must have an odd request ID. Make sure that is the case. + int bidir_flag = + this->transport_->bidirectional_flag (); + + if ((bidir_flag == 1 && ACE_ODD (this->request_id_generator_)) + || (bidir_flag == 0 && ACE_EVEN (this->request_id_generator_))) + ++this->request_id_generator_; + + if (TAO_debug_level > 4) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) TAO_Muxed_TMS::request_id - <%d>\n"), + this->request_id_generator_)); + + return this->request_id_generator_; } // Bind the dispatcher with the request id. @@ -45,8 +66,8 @@ TAO_Muxed_TMS::bind_dispatcher (CORBA::ULong request_id, if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P | %t):TAO_Muxed_TMS::bind_dispatcher: ") - ACE_TEXT ("bind dispatcher failed: result = %d\n"), - result)); + ACE_TEXT ("bind dispatcher failed: result = %d, request id = %d \n"), + result, request_id)); return -1; } diff --git a/TAO/tao/Muxed_TMS.h b/TAO/tao/Muxed_TMS.h index 0824dc1d72f..124f5839ae2 100644 --- a/TAO/tao/Muxed_TMS.h +++ b/TAO/tao/Muxed_TMS.h @@ -83,19 +83,6 @@ protected: /// Keep track of the orb core pointer. We need to this to create the /// Reply Dispatchers. TAO_ORB_Core *orb_core_; - - // @@ Commented for the time being, let the commented line stay for - // sometime - Bala - // TAO_GIOP_Message_State *message_state_; - // Message state where the current input message is being read. This - // is created at start of each incoming message. When that message - // is read, the message is processed and for the next message a new - // message state is created. - - // @@ Having members of type TAO_GIOP* indicates that we - // (Transport_Mux_Strategy) are aware of the underlying messaging - // protocol. But for the present let us close our eyes till we are - // able to iterate on a use case - Bala. }; #include "ace/post.h" diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index f1a4d525b72..614b83a7050 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -260,8 +260,8 @@ public: CORBA::Octet minor) = 0; /// Get/Set the bidirectional flag - virtual int bidirectional_flag (void) const; - virtual void bidirectional_flag (int flag); + int bidirectional_flag (void) const; + void bidirectional_flag (int flag); /// Fill in a handle_set with any associated handler's reactor handle. /** |