TAO_UIOP_Transport Class Reference

Specialization of the base TAO_Transport class to handle the UIOP protocol. More...

#include <UIOP_Transport.h>

Inheritance diagram for TAO_UIOP_Transport:

Inheritance graph
[legend]
Collaboration diagram for TAO_UIOP_Transport:

Collaboration graph
[legend]
List of all members.

Overridden Template Methods

These are implementations of template methods declared by TAO_Transport.

virtual int send_request (TAO_Stub *stub, TAO_ORB_Core *orb_core, TAO_OutputCDR &stream, TAO_Message_Semantics message_semantics, ACE_Time_Value *max_wait_time)
virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub=0, TAO_Message_Semantics message_semantics=TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait=0)
virtual ACE_Event_Handlerevent_handler_i (void)
virtual TAO_Connection_Handlerconnection_handler_i (void)
virtual ssize_t send (iovec *iov, int iovcnt, size_t &bytes_transferred, const ACE_Time_Value *timeout=0)
 Write the complete Message_Block chain to the connection.
virtual ssize_t recv (char *buf, size_t len, const ACE_Time_Value *s=0)
 Read len bytes from into buf.

Public Member Functions

 TAO_UIOP_Transport (TAO_UIOP_Connection_Handler *handler, TAO_ORB_Core *orb_core)
 Constructor.
 ~TAO_UIOP_Transport (void)
 Default destructor.

Private Attributes

TAO_UIOP_Connection_Handlerconnection_handler_

Detailed Description

Specialization of the base TAO_Transport class to handle the UIOP protocol.

Definition at line 51 of file UIOP_Transport.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_UIOP_Transport::TAO_UIOP_Transport ( TAO_UIOP_Connection_Handler handler,
TAO_ORB_Core orb_core 
)

Constructor.

Definition at line 25 of file UIOP_Transport.cpp.

00027   : TAO_Transport (TAO_TAG_UIOP_PROFILE,
00028                    orb_core)
00029   , connection_handler_ (handler)
00030 {
00031 }

TAO_UIOP_Transport::~TAO_UIOP_Transport ( void   ) 

Default destructor.

Definition at line 33 of file UIOP_Transport.cpp.

00034 {
00035 }


Member Function Documentation

TAO_Connection_Handler * TAO_UIOP_Transport::connection_handler_i ( void   )  [protected, virtual]

Todo:
These methods IMHO should have more meaningful names. The names seem to indicate nothing.

Implements TAO_Transport.

Definition at line 44 of file UIOP_Transport.cpp.

References connection_handler_.

00045 {
00046   return this->connection_handler_;
00047 }

ACE_Event_Handler * TAO_UIOP_Transport::event_handler_i ( void   )  [protected, virtual]

Todo:
These methods IMHO should have more meaningful names. The names seem to indicate nothing.

Implements TAO_Transport.

Definition at line 38 of file UIOP_Transport.cpp.

References connection_handler_.

00039 {
00040   return this->connection_handler_;
00041 }

ssize_t TAO_UIOP_Transport::recv ( char *  buf,
size_t  len,
const ACE_Time_Value s = 0 
) [protected, virtual]

Read len bytes from into buf.

Implements TAO_Transport.

Definition at line 64 of file UIOP_Transport.cpp.

References ACE_DEBUG, ACE_TEXT, connection_handler_, LM_DEBUG, ACE_Svc_Handler<, >::peer(), and TAO_debug_level.

00067 {
00068   const ssize_t n = this->connection_handler_->peer ().recv (buf,
00069                                                              len,
00070                                                              max_wait_time);
00071 
00072   // Most of the errors handling is common for
00073   // Now the message has been read
00074   if (n == -1 &&
00075       TAO_debug_level > 4 &&
00076       errno != ETIME)
00077     {
00078       ACE_DEBUG ((LM_DEBUG,
00079                   ACE_TEXT ("TAO (%P|%t) - UIOP_Transport::recv, %p %p \n"),
00080                   ACE_TEXT ("TAO - read message failure ")
00081                   ACE_TEXT ("recv () \n")));
00082     }
00083 
00084   // Error handling
00085   if (n == -1)
00086     {
00087       if (errno == EWOULDBLOCK)
00088         return 0;
00089 
00090       return -1;
00091     }
00092   // @@ What are the other error handling here??
00093   else if (n == 0)
00094     {
00095       return -1;
00096     }
00097 
00098   return n;
00099 }

ssize_t TAO_UIOP_Transport::send ( iovec *  iov,
int  iovcnt,
size_t &  bytes_transferred,
const ACE_Time_Value timeout = 0 
) [protected, virtual]

Write the complete Message_Block chain to the connection.

Implements TAO_Transport.

Definition at line 50 of file UIOP_Transport.cpp.

References connection_handler_, and ACE_Svc_Handler<, >::peer().

00053 {
00054   ssize_t const retval =
00055     this->connection_handler_->peer ().sendv (iov, iovcnt, max_wait_time);
00056 
00057   if (retval > 0)
00058     bytes_transferred = retval;
00059 
00060   return retval;
00061 }

int TAO_UIOP_Transport::send_message ( TAO_OutputCDR stream,
TAO_Stub stub = 0,
TAO_Message_Semantics  message_semantics = TAO_Transport::TAO_TWOWAY_REQUEST,
ACE_Time_Value max_time_wait = 0 
) [virtual]

Todo:
These methods IMHO should have more meaningful names. The names seem to indicate nothing.

Definition at line 120 of file UIOP_Transport.cpp.

References ACE_DEBUG, ACE_TEXT, ACE_OutputCDR::begin(), LM_DEBUG, TAO_Transport::send_message_shared(), and TAO_debug_level.

00124 {
00125   // Format the message in the stream first
00126   if (this->messaging_object_->format_message (stream) != 0)
00127     return -1;
00128 
00129   // Strictly speaking, should not need to loop here because the
00130   // socket never gets set to a nonblocking mode ... some Linux
00131   // versions seem to need it though.  Leaving it costs little.
00132 
00133   // This guarantees to send all data (bytes) or return an error.
00134   const ssize_t n = this->send_message_shared (stub,
00135                                                message_semantics,
00136                                                stream.begin (),
00137                                                max_wait_time);
00138 
00139   if (n == -1)
00140     {
00141       if (TAO_debug_level)
00142         ACE_DEBUG ((LM_DEBUG,
00143                     ACE_TEXT ("TAO (%P|%t) closing transport %d after fault %p\n"),
00144                     this->id (),
00145                     ACE_TEXT ("send_message ()\n")));
00146 
00147       return -1;
00148     }
00149 
00150   return 1;
00151 }

int TAO_UIOP_Transport::send_request ( TAO_Stub stub,
TAO_ORB_Core orb_core,
TAO_OutputCDR stream,
TAO_Message_Semantics  message_semantics,
ACE_Time_Value max_wait_time 
) [virtual]

Todo:
These methods IMHO should have more meaningful names. The names seem to indicate nothing.

Definition at line 102 of file UIOP_Transport.cpp.

References TAO_Transport::first_request_sent(), and TAO_Transport::orb_core().

00107 {
00108   if (this->ws_->sending_request (orb_core, message_semantics) == -1)
00109     return -1;
00110 
00111   if (this->send_message (stream, stub, message_semantics, max_wait_time) == -1)
00112     return -1;
00113 
00114   this->first_request_sent();
00115 
00116   return 0;
00117 }


Member Data Documentation

TAO_UIOP_Connection_Handler* TAO_UIOP_Transport::connection_handler_ [private]

The connection service handler used for accessing lower layer communication protocols.

Definition at line 101 of file UIOP_Transport.h.

Referenced by connection_handler_i(), event_handler_i(), recv(), and send().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:47:36 2010 for TAO_Strategies by  doxygen 1.4.7