diff options
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 26 | ||||
-rw-r--r-- | TAO/docs/pluggable_protocols/index.html | 4 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp | 34 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h | 5 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.cpp | 32 | ||||
-rw-r--r-- | TAO/tao/IIOP_Transport.h | 5 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Transport.cpp | 32 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Transport.h | 6 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Transport.cpp | 32 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Transport.h | 5 | ||||
-rw-r--r-- | TAO/tao/Transport.cpp | 18 | ||||
-rw-r--r-- | TAO/tao/Transport.h | 82 | ||||
-rw-r--r-- | TAO/tao/things_that_needs | 6 |
13 files changed, 140 insertions, 147 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 09cdb87a471..32e3e847a6a 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,29 @@ +Wed Jan 24 17:00:52 2001 Carlos O'Ryan <coryan@uci.edu> + + * tao/Transport.h: + Document the design for the new treatment of outgoing data, + basically it should supports non-blocking (reactive) I/O, queued + messages, urgent data, per-message timeouts and multiple threads + waiting on outgoing messages (ala Leader/Followers). + + * tao/Transport.h: + * tao/Transport.cpp: + * tao/IIOP_Transport.h: + * tao/IIOP_Transport.cpp: + * tao/Strategies/UIOP_Transport.h: + * tao/Strategies/UIOP_Transport.cpp: + * tao/Strategies/SHMIOP_Transport.h: + * tao/Strategies/SHMIOP_Transport.cpp: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp: + Factored out common code into the TAO_Transport class. + + * tao/things_that_needs: + Removed spurious file + + * docs/pluggable_protocols/index.html: + Fixed my homepage. + Wed Jan 24 18:09:12 2001 Jeff Parsons <parsons@cs.wustl.edu> * tao/Domain/TAO_Domain.dsp: diff --git a/TAO/docs/pluggable_protocols/index.html b/TAO/docs/pluggable_protocols/index.html index 38df57469fe..640124c4274 100644 --- a/TAO/docs/pluggable_protocols/index.html +++ b/TAO/docs/pluggable_protocols/index.html @@ -22,7 +22,7 @@ <STRONG> <A HREF="http://www.cs.wustl.edu/~fredk/">Fred Kuhns</A>, <A HREF="http://www.ece.uci.edu/~schmidt/">Douglas C. Schmidt</A>, -<A HREF="http://www.ece.uci.edu/~coryan">Carlos O'Ryan</A>, +<A HREF="http://doc.ece.uci.edu/~coryan">Carlos O'Ryan</A>, <A HREF="http://www.ece.uci.edu/~ossama/">Ossama Othman</A>, and <A HREF="mailto:BTRASK@contactsystems.com">Bruce Trask</A> </STRONG> @@ -2986,7 +2986,7 @@ examples of the Layers architecture. <ADDRESS><a href="mailto:ossama@uci.edu">Ossama Othman</a></ADDRESS> <!-- Created: Tue Dec 14 16:53:58 CST 1999 --> <!-- hhmts start --> -Last modified: Tue May 2 11:35:31 CDT 2000 +Last modified: Wed Jan 24 08:28:07 PST 2001 <!-- hhmts end --> </BODY> </HTML> diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp index d5506907595..12fb19ebf04 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp @@ -74,30 +74,6 @@ TAO_SSLIOP_Transport::idle (void) return this->connection_handler_->make_idle (); } - -ssize_t -TAO_SSLIOP_Transport::send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *message_block, - const ACE_Time_Value *max_wait_time) -{ - if (stub == 0 || two_way) - { - return this->send (message_block, - max_wait_time); - } - else - { - TAO_Sync_Strategy &sync_strategy = stub->sync_strategy (); - - return sync_strategy.send (*this, - *stub, - message_block, - max_wait_time); - } -} - - ssize_t TAO_SSLIOP_Transport::send (const ACE_Message_Block *message_block, const ACE_Time_Value *max_wait_time, @@ -285,10 +261,10 @@ TAO_SSLIOP_Transport::send_message (TAO_OutputCDR &stream, // versions seem to need it though. Leaving it costs little. // This guarantees to send all data (bytes) or return an error. - ssize_t n = this->send (stub, - twoway, - stream.begin (), - max_wait_time); + ssize_t n = this->send_or_buffer (stub, + twoway, + stream.begin (), + max_wait_time); if (n == -1) { @@ -364,7 +340,7 @@ TAO_SSLIOP_Transport::send_request_header (TAO_Operation_Details &opdetails, { this->set_bidir_context_info (opdetails); - // Set the flag to 0 + // Set the flag to 0 this->bidirectional_flag (0); } diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h index e4407151e87..965522eb2a5 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.h @@ -76,11 +76,6 @@ public: virtual int idle (void); /// Write the complete Message_Block chain to the connection. - virtual ssize_t send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *mblk, - const ACE_Time_Value *s = 0); - virtual ssize_t send (const ACE_Message_Block *mblk, const ACE_Time_Value *s = 0, size_t *bytes_transferred = 0); diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index 8d0046ec5ec..a4205e6b360 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -85,30 +85,6 @@ TAO_IIOP_Transport::idle (void) return this->connection_handler_->make_idle (); } - -ssize_t -TAO_IIOP_Transport::send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *message_block, - const ACE_Time_Value *max_wait_time) -{ - if (stub == 0 || two_way) - { - return this->send (message_block, - max_wait_time); - } - else - { - TAO_Sync_Strategy &sync_strategy = stub->sync_strategy (); - - return sync_strategy.send (*this, - *stub, - message_block, - max_wait_time); - } -} - - ssize_t TAO_IIOP_Transport::send (const ACE_Message_Block *message_block, const ACE_Time_Value *max_wait_time, @@ -236,10 +212,10 @@ TAO_IIOP_Transport::send_message (TAO_OutputCDR &stream, // versions seem to need it though. Leaving it costs little. // This guarantees to send all data (bytes) or return an error. - ssize_t n = this->send (stub, - twoway, - stream.begin (), - max_wait_time); + ssize_t n = this->send_or_buffer (stub, + twoway, + stream.begin (), + max_wait_time); if (n == -1) { diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h index e525c50c019..ddb389b8829 100644 --- a/TAO/tao/IIOP_Transport.h +++ b/TAO/tao/IIOP_Transport.h @@ -75,11 +75,6 @@ public: virtual int idle (void); /// Write the complete Message_Block chain to the connection. - virtual ssize_t send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *mblk, - const ACE_Time_Value *s = 0); - virtual ssize_t send (const ACE_Message_Block *mblk, const ACE_Time_Value *s = 0, size_t *bytes_transferred = 0); diff --git a/TAO/tao/Strategies/SHMIOP_Transport.cpp b/TAO/tao/Strategies/SHMIOP_Transport.cpp index 771f4ae8a2b..142721cf68c 100644 --- a/TAO/tao/Strategies/SHMIOP_Transport.cpp +++ b/TAO/tao/Strategies/SHMIOP_Transport.cpp @@ -89,30 +89,6 @@ TAO_SHMIOP_Transport::idle (void) return this->connection_handler_->make_idle (); } - -ssize_t -TAO_SHMIOP_Transport::send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *message_block, - const ACE_Time_Value *max_wait_time) -{ - if (stub == 0 || two_way) - { - return this->send (message_block, - max_wait_time); - } - else - { - TAO_Sync_Strategy &sync_strategy = stub->sync_strategy (); - - return sync_strategy.send (*this, - *stub, - message_block, - max_wait_time); - } -} - - ssize_t TAO_SHMIOP_Transport::send (const ACE_Message_Block *message_block, const ACE_Time_Value *max_wait_time, @@ -238,10 +214,10 @@ TAO_SHMIOP_Transport::send_message (TAO_OutputCDR &stream, // versions seem to need it though. Leaving it costs little. // This guarantees to send all data (bytes) or return an error. - ssize_t n = this->send (stub, - twoway, - stream.begin (), - max_wait_time); + ssize_t n = this->send_or_buffer (stub, + twoway, + stream.begin (), + max_wait_time); if (n == -1) { diff --git a/TAO/tao/Strategies/SHMIOP_Transport.h b/TAO/tao/Strategies/SHMIOP_Transport.h index b13c1a9fa99..e440855aecd 100644 --- a/TAO/tao/Strategies/SHMIOP_Transport.h +++ b/TAO/tao/Strategies/SHMIOP_Transport.h @@ -69,16 +69,10 @@ public: virtual int idle (void); /// Write the complete Message_Block chain to the connection. - virtual ssize_t send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *mblk, - const ACE_Time_Value *s = 0); - virtual ssize_t send (const ACE_Message_Block *mblk, const ACE_Time_Value *s = 0, size_t *bytes_transferred = 0); - /// Write the contents of the buffer of length len to the /// connection. virtual ssize_t send (const u_char *buf, diff --git a/TAO/tao/Strategies/UIOP_Transport.cpp b/TAO/tao/Strategies/UIOP_Transport.cpp index e239098d721..ed1b05acf10 100644 --- a/TAO/tao/Strategies/UIOP_Transport.cpp +++ b/TAO/tao/Strategies/UIOP_Transport.cpp @@ -90,30 +90,6 @@ TAO_UIOP_Transport::idle (void) return this->connection_handler_->make_idle (); } - -ssize_t -TAO_UIOP_Transport::send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *message_block, - const ACE_Time_Value *max_wait_time) -{ - if (stub == 0 || two_way) - { - return this->send (message_block, - max_wait_time); - } - else - { - TAO_Sync_Strategy &sync_strategy = stub->sync_strategy (); - - return sync_strategy.send (*this, - *stub, - message_block, - max_wait_time); - } -} - - ssize_t TAO_UIOP_Transport::send (const ACE_Message_Block *message_block, const ACE_Time_Value *max_wait_time, @@ -240,10 +216,10 @@ TAO_UIOP_Transport::send_message (TAO_OutputCDR &stream, // versions seem to need it though. Leaving it costs little. // This guarantees to send all data (bytes) or return an error. - ssize_t n = this->send (stub, - twoway, - stream.begin (), - max_wait_time); + ssize_t n = this->send_or_buffer (stub, + twoway, + stream.begin (), + max_wait_time); if (n == -1) { diff --git a/TAO/tao/Strategies/UIOP_Transport.h b/TAO/tao/Strategies/UIOP_Transport.h index 0dfcb6a5eb3..2f8ee8d0116 100644 --- a/TAO/tao/Strategies/UIOP_Transport.h +++ b/TAO/tao/Strategies/UIOP_Transport.h @@ -74,11 +74,6 @@ public: virtual int idle (void); /// Write the complete Message_Block chain to the connection. - virtual ssize_t send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *mblk, - const ACE_Time_Value *s = 0); - virtual ssize_t send (const ACE_Message_Block *mblk, const ACE_Time_Value *s = 0, size_t *bytes_transferred = 0); diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 071635d1e93..cbac6b18bcb 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -8,6 +8,8 @@ #include "Client_Strategy_Factory.h" #include "Wait_Strategy.h" #include "Transport_Mux_Strategy.h" +#include "Stub.h" +#include "Sync_Strategies.h" #if !defined (__ACE_INLINE__) # include "Transport.inl" @@ -45,6 +47,22 @@ TAO_Transport::~TAO_Transport (void) delete this->buffering_queue_; } +ssize_t +TAO_Transport::send_or_buffer (TAO_Stub *stub, + int two_way, + const ACE_Message_Block *message_block, + const ACE_Time_Value *max_wait_time) +{ + if (stub == 0 || two_way) + return this->send (message_block, max_wait_time); + + TAO_Sync_Strategy &sync_strategy = stub->sync_strategy (); + + return sync_strategy.send (*this, + *stub, + message_block, + max_wait_time); +} ssize_t TAO_Transport::send_buffered_messages (const ACE_Time_Value *max_wait_time) diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index 7607ba7086f..31dd8bc6f1d 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -43,6 +43,78 @@ typedef ACE_Message_Queue<ACE_NULL_SYNCH> TAO_Transport_Buffering_Queue; * * The transport object is created in the Service handler * constructor and deleted in the Service Handler's destructor!! + * + * The main responsability of a Transport object is to encapsulate a + * connection, and provide a transport independent way to send and + * receive data. Since TAO is heavily based on the Reactor for all if + * not all its I/O the Transport class is usually implemented with a + * helper Connection Handler that adapts the generic Transport + * interface to the Reactor types. + * + * <H3>The outgoing data path:</H3> + * + * One of the responsabilities of the TAO_Transport class is to send + * out GIOP messages as efficiently as possible. In most cases + * messages are put out in FIFO order, the transport object will put + * out the message using a single system call and return control to + * the application. However, for oneways and AMI requests it may be + * more efficient (or required if the SYNC_NONE policy is in effect) + * to queue the messages until a large enough data set can be put out. + * Also, large messages may not be sent out without blocking, and in + * some applications blocking for I/O is unacceptable. + * + * Therefore, the Transport class may need to use a queue to + * temporarily hold the messages, and, in some configurations, it may + * need to use the Reactor to concurrently drain such queues. + * + * <H4>Out of order messages:</H4> TAO provides explicit policies to + * send 'urgent' messages. Such messages may put at the head of the + * queue. However, they cannot be sent immediately because the + * transport may already be sending another message in a reactive + * fashion. + * + * Consequently, the Transport must also keep a + * <TT>current_message</TT>, if the current message is not null any + * new messages must be queued. Only once the current message is + * completely sent we can take a message out of the queue. + * + * <H4>Waiting threads:</H4> One or more threads can be blocked + * waiting for the connection to completely send the message. + * The thread should return as soon as its message has been sent, so a + * per-thread condition is required. This suggest that simply using a + * ACE_Message_Queue would not be enough: there is a significant + * amount of ancillary information, to keep on each message that the + * Message_Block class does not provide room for. + * + * Also some applications may choose, for performance reasons or to + * avoid complex concurrency scenarios due to nested upcalls, to + * using blocking I/O + * block the + * + * <H4>Timeouts:</H4> Some or all messages could have a timeout period + * attached to them. The timeout source could either be some + * high-level policy or maybe some strategy to prevent denial of + * service attacks. In any case the timeouts are per-message, and + * later messages could have shorter timeouts. + * In fact, some kind of scheduling (such as EDF) could be required in + * a few applications. + * + * <H4>Conclusions:</H4> The outgoing data path consist in several + * components: + * - A queue of pending messages + * - A message currently being transmitted + * - A per-message waiting + * + * + * <H3>The incoming data path:</H3> + * + * @todo Document the incoming data path design forces. + * + * + * <B>See Also:</B> + * + * http://ace.cs.wustl.edu/cvsweb/ace-latest.cgi/ACE_wrappers/TAO/docs/pluggable_protocols/index.html + * */ class TAO_Export TAO_Transport { @@ -77,11 +149,6 @@ public: /// handler used by the reactor. virtual ACE_Event_Handler *event_handler (void) = 0; - virtual ssize_t send (TAO_Stub *stub, - int two_way, - const ACE_Message_Block *mblk, - const ACE_Time_Value *s = 0) = 0; - virtual ssize_t send (const ACE_Message_Block *mblk, const ACE_Time_Value *s = 0, size_t *bytes_transferred = 0) = 0; @@ -163,6 +230,11 @@ public: /// Return the Wait strategy used by the Transport. TAO_Wait_Strategy *wait_strategy (void) const; + ssize_t send_or_buffer (TAO_Stub *stub, + int two_way, + const ACE_Message_Block *mblk, + const ACE_Time_Value *s = 0); + /** * Read and process the message on the connection. If <block> is 1, * then reply is read in a blocking manner. Once the message has diff --git a/TAO/tao/things_that_needs b/TAO/tao/things_that_needs deleted file mode 100644 index 2211ee7fb03..00000000000 --- a/TAO/tao/things_that_needs +++ /dev/null @@ -1,6 +0,0 @@ -- GIOP lite -- other transports -- Why does the rd_ptr () not align when - we use a cdr allocator from ORB_Core?? -- Fix faults test -- write a new test as Carlos suggested |