From 8f0b00aa93a7c81d17b47638f71e003d1d75f4bc Mon Sep 17 00:00:00 2001 From: Chris Cleeland Date: Mon, 15 Dec 2003 22:31:47 +0000 Subject: Tag: pmb_integration Started work on performance enhancements for PMB. --- TAO/tao/Transport.h | 104 +++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 54 deletions(-) diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index b6059b211fe..4b885eb40e5 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -447,7 +447,6 @@ public: virtual ACE_Event_Handler * event_handler_i (void) = 0; protected: - virtual TAO_Connection_Handler * connection_handler_i (void) = 0; public: @@ -489,6 +488,7 @@ public: virtual int handle_input (TAO_Resume_Handle &rh, ACE_Time_Value *max_wait_time = 0, int block = 0); + void try_to_complete (ACE_Time_Value *max_wait_time); enum { @@ -568,60 +568,11 @@ public: protected: - /// Called by the handle_input_i (). This method is used to parse - /// message read by the handle_input_i () call. It also decides - /// whether the message needs consolidation before processing. - int parse_consolidate_messages (ACE_Message_Block &bl, - TAO_Resume_Handle &rh, - ACE_Time_Value *time = 0); - - - /// Method does parsing of the message if we have a fresh message in - /// the or just returns if we have read part of the - /// previously stored message. - int parse_incoming_messages (ACE_Message_Block &message_block); - - /// Return if we have any missing data in the queue of messages - /// or determine if we have more information left out in the - /// presently read message to make it complete. - size_t missing_data (ACE_Message_Block &message_block); - - /// Consolidate the currently read message or consolidate the last - /// message in the queue. The consolidation of the last message in - /// the queue is done by calling consolidate_message_queue (). - virtual int consolidate_message (ACE_Message_Block &incoming, - ssize_t missing_data, - TAO_Resume_Handle &rh, - ACE_Time_Value *max_wait_time); - - /// @@Bala: Docu??? - int consolidate_fragments (TAO_Queued_Data *qd, - TAO_Resume_Handle &rh); - - /// First consolidate the message queue. If the message is still not - /// complete, try to read from the handle again to make it - /// complete. If these dont help put the message back in the queue - /// and try to check the queue if we have message to process. (the - /// thread needs to do some work anyway :-)) - int consolidate_message_queue (ACE_Message_Block &incoming, - ssize_t missing_data, - TAO_Resume_Handle &rh, - ACE_Time_Value *max_wait_time); - - /// Called by parse_consolidate_message () if we have more messages - /// in one read. Queue up the messages and try to process one of - /// them, atleast at the head of them. - int consolidate_extra_messages (ACE_Message_Block &incoming, - TAO_Resume_Handle &rh); - /// Process the message by sending it to the higher layers of the /// ORB. int process_parsed_messages (TAO_Queued_Data *qd, TAO_Resume_Handle &rh); - /// Make a queued data from the message block - TAO_Queued_Data *make_queued_data (ACE_Message_Block &incoming); - /// Implement send_message_shared() assuming the handler_lock_ is /// held. int send_message_shared_i (TAO_Stub *stub, @@ -669,6 +620,40 @@ public: int handle_timeout (const ACE_Time_Value ¤t_time, const void* act); + /// Accessor to recv_buffer_size_ + size_t recv_buffer_size (void); + + /// Accessor to sent_byte_count_ + size_t sent_byte_count (void); + + + /*! + \name Incoming Queue Methods + */ + //@{ + /*! + \brief Queue up \a queueable_message as a completely-received incoming message. + + This method queues up a completely-received queueable GIOP message + (i.e., it must be dynamically-allocated). It does not assemble a + complete GIOP message; that should be done prior to calling this + message, and is currently done in handle_input_i. + + This does, however, assure that a completely-received GIOP + FRAGMENT gets associated with any previously-received related + fragments. It does this through collaboration with the messaging + object (since fragment reassembly is protocol specific). + + \param queueable_message instance as returned by one of the TAO_Queued_Data::make_*_message that's been completely received + + \return 0 successfully enqueued \a queueable_message + + \return -1 failed to enqueue \a queueable_message + \todo How do we indicate \em what may have failed? + */ + int enqueue_incoming_message (TAO_Queued_Data *queueable_message); + //@} + /// CodeSet Negotiation - Get the char codeset translator factory /// TAO_Codeset_Translator_Factory *char_translator (void) const; @@ -792,10 +777,14 @@ 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 calls - * this->notify_reactor () to wake up a thread + * this->notify_reactor () to wake up a thread. + * + * \return -1 An error occurred; occurs independent presence of messages in the queue. + * \return 1 No messages in the queue to process; nothing processed. + * \return 0 Messages were in the queue to process and one got processed. */ int process_queue_head (TAO_Resume_Handle &rh); @@ -856,9 +845,12 @@ protected: TAO_Queued_Message *head_; TAO_Queued_Message *tail_; - /// Queue of the incoming messages.. + /// Queue of the completely-received incoming messages.. TAO_Incoming_Message_Queue incoming_message_queue_; + /// Place to hold a partially-received (waiting-to-be-completed) message + TAO_Queued_Data * uncompleted_message_; + /// The queue will start draining no later than /// *if* the deadline is ACE_Time_Value current_deadline_; @@ -893,8 +885,11 @@ protected: /// Used by the LRU, LFU and FIFO Connection Purging Strategies. unsigned long purging_order_; -private: + /// Size of the buffer received. + size_t recv_buffer_size_; + /// Number of bytes sent. + size_t sent_byte_count_; /// @@Phil, I think it would be nice if we could think of a way to /// do the following. /// We have been trying to use the transport for marking about @@ -907,6 +902,7 @@ private: /// we can move this to the connection_handler and it may more sense /// with the DSCP stuff around there. Do you agree? +private: /// Additional member values required to support codeset translation TAO_Codeset_Translator_Factory *char_translator_; TAO_Codeset_Translator_Factory *wchar_translator_; -- cgit v1.2.1