diff options
author | bala <balanatarajan@users.noreply.github.com> | 2001-06-28 23:29:14 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2001-06-28 23:29:14 +0000 |
commit | cc1ba5fdcba9191a0825942c08a173e3df01fd6e (patch) | |
tree | 965c8b97f68adad08171c60c9101fe1d2c9907be | |
parent | d6be9556ccfdb1d707b06a5480b442b2fd9c8006 (diff) | |
download | ATCD-cc1ba5fdcba9191a0825942c08a173e3df01fd6e.tar.gz |
ChangeLogTag: Thu Jun 28 18:25:03 2001 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | TAO/tao/GIOP_Message_Base.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Transport.cpp | 100 | ||||
-rw-r--r-- | TAO/tao/Transport.h | 5 |
3 files changed, 58 insertions, 49 deletions
diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 8b11f64a495..65493035213 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -342,8 +342,6 @@ TAO_GIOP_Message_Base::missing_data (ACE_Message_Block &incoming) if (len > msg_size) { - // Move the rd_ptr so that we can extract the next message. - // incoming.rd_ptr (msg_size); return -1; } else if (len == msg_size) diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 5bc7d33004f..319132a151a 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -1028,27 +1028,7 @@ TAO_Transport::consolidate_message_queue (ACE_Message_Block &incoming, this->incoming_message_queue_.enqueue_tail (qd); } - // See if the message in the head of the queue is complete... - if (this->incoming_message_queue_.is_head_complete () == 1) - { - // Get the message on the head of the queue.. - TAO_Queued_Data *qd = - this->incoming_message_queue_.dequeue_head (); - - // Process the message... - if (this->process_parsed_messages (qd, - rh) == -1) - return -1; - - // Delete the message block first - // delete qd->msg_block_; - - // Delete the Queued_Data.. - delete qd; - - } - - return 0; + return this->process_queue_head (rh); } @@ -1057,14 +1037,11 @@ TAO_Transport::consolidate_extra_messages (ACE_Message_Block &incoming, TAO_Resume_Handle &rh) { - // @@Bala: What about messages that dont even have their first few - // bytes in... - // Take a message from the tail.. TAO_Queued_Data *tail = this->incoming_message_queue_.dequeue_tail (); - if (tail ) + if (tail) { if (this->messaging_object ()->consolidate_node (tail, incoming) == -1) @@ -1085,33 +1062,12 @@ TAO_Transport::consolidate_extra_messages (ACE_Message_Block this->incoming_message_queue_.enqueue_tail (q_data); } - - - // See if the message in the head of the queue is complete... - if (this->incoming_message_queue_.is_head_complete () == 1) - { - // Get the message on the head of the queue.. - TAO_Queued_Data *qd = - this->incoming_message_queue_.dequeue_head (); - - // Process the message... - if (this->process_parsed_messages (qd, - rh) == -1) - return -1; - - // Delete the message_block - // delete qd->msg_block_; - - // Delete the Queued_Data.. - delete qd; - } - if (retval == -1) { return retval; } - return 0; + return this->process_queue_head (rh); } int @@ -1251,6 +1207,56 @@ TAO_Transport::process_parsed_messages (TAO_Queued_Data *qd, } int +TAO_Transport::process_queue_head (TAO_Resume_Handle &rh) +{ + // See if the message in the head of the queue is complete... + if (this->incoming_message_queue_.is_head_complete () == 1) + { + // Get the message on the head of the queue.. + TAO_Queued_Data *qd = + this->incoming_message_queue_.dequeue_head (); + + // Now that we have pulled out out one message out of the queue, + // check whether we have one more message in the queue... + if (this->incoming_message_queue_.is_head_complete () == 1) + { + // If we do have, then we get the event handler.. + ACE_Event_Handler *eh = this->event_handler_i (); + if (eh == 0) + return -1; + + ACE_Reactor *reactor = eh->reactor (); + if (reactor == 0) + return -1; + + if (TAO_debug_level > 3) + { + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Transport[%d]::notify to Reactor\n", + this->id ())); + } + + // Send a notification to the reactor... + reactor->notify (eh, + ACE_Event_Handler::READ_MASK); + } + // Process the message... + if (this->process_parsed_messages (qd, + rh) == -1) + return -1; + + // Delete the message_block + // delete qd->msg_block_; + + // Delete the Queued_Data.. + delete qd; + } + + return 0; +} + + +int TAO_Transport::queue_is_empty (void) { ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->handler_lock_, -1); diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index f9ee20e120a..f7fe3f6f3f2 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -747,6 +747,11 @@ private: /// Print out error messages if the event handler is not valid void report_invalid_event_handler (const char *caller); + /// Process the message that is in the head of the incoming queue. + /// If there are more messages in the queue, this method sends a + /// notify () to the reactor to send a next thread along. + int process_queue_head (TAO_Resume_Handle &rh); + /// Prohibited ACE_UNIMPLEMENTED_FUNC (TAO_Transport (const TAO_Transport&)) ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Transport&)) |