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, int message_semantics, ACE_Time_Value *max_wait_time)
virtual int send_message (TAO_OutputCDR &stream, TAO_Stub *stub=0, int message_semantics=TAO_Transport::TAO_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait=0)
virtual int messaging_init (CORBA::Octet major, CORBA::Octet minor)
 Initialising the messaging object.

virtual ACE_Event_Handlerevent_handler_i (void)
virtual TAO_Connection_Handlerconnection_handler_i (void)
virtual TAO_Pluggable_Messagingmessaging_object (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, CORBA::Boolean flag)
 Constructor.

 ~TAO_UIOP_Transport (void)
 Default destructor.


Private Attributes

TAO_UIOP_Connection_Handlerconnection_handler_
TAO_Pluggable_Messagingmessaging_object_
 Our messaging object.


Detailed Description

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

Definition at line 52 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,
CORBA::Boolean  flag
 

Constructor.

Definition at line 26 of file UIOP_Transport.cpp.

References ACE_NEW, and TAO_TAG_UIOP_PROFILE.

00029   : TAO_Transport (TAO_TAG_UIOP_PROFILE,
00030                    orb_core)
00031   , connection_handler_ (handler)
00032   , messaging_object_ (0)
00033 {
00034 
00035 /*
00036  * Hook to customize the messaging object when the concrete messaging
00037  * object is known a priori. In this case, the flag is ignored.
00038  */
00039 //@@ MESSAGING_SPL_COMMENT_HOOK_START
00040   if (flag)
00041     {
00042       // Use the lite version of the protocol
00043       ACE_NEW (this->messaging_object_,
00044                TAO_GIOP_Message_Lite (orb_core));
00045     }
00046   else
00047     {
00048       // Use the normal GIOP object
00049       ACE_NEW (this->messaging_object_,
00050                TAO_GIOP_Message_Base (orb_core, this));
00051     }
00052 //@@ MESSAGING_SPL_COMMENT_HOOK_END
00053 }

TAO_UIOP_Transport::~TAO_UIOP_Transport void   ) 
 

Default destructor.

Definition at line 55 of file UIOP_Transport.cpp.

00056 {
00057   delete this->messaging_object_;
00058 }


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 67 of file UIOP_Transport.cpp.

00068 {
00069   return this->connection_handler_;
00070 }

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 61 of file UIOP_Transport.cpp.

00062 {
00063   return this->connection_handler_;
00064 }

int TAO_UIOP_Transport::messaging_init CORBA::Octet  major,
CORBA::Octet  minor
[virtual]
 

Initialising the messaging object.

Implements TAO_Transport.

Definition at line 190 of file UIOP_Transport.cpp.

References TAO_Pluggable_Messaging::init().

00192 {
00193   this->messaging_object_->init (major,
00194                                  minor);
00195   return 1;
00196 }

TAO_Pluggable_Messaging * TAO_UIOP_Transport::messaging_object void   )  [protected, virtual]
 

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

Implements TAO_Transport.

Definition at line 73 of file UIOP_Transport.cpp.

00074 {
00075   return this->messaging_object_;
00076 }

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 95 of file UIOP_Transport.cpp.

References ACE_DEBUG, ACE_TEXT, ETIME, EWOULDBLOCK, LM_DEBUG, ACE_Svc_Handler<, >::peer(), ssize_t, and TAO_debug_level.

00098 {
00099   const ssize_t n = this->connection_handler_->peer ().recv (buf,
00100                                                              len,
00101                                                              max_wait_time);
00102 
00103   // Most of the errors handling is common for
00104   // Now the message has been read
00105   if (n == -1 &&
00106       TAO_debug_level > 4 &&
00107       errno != ETIME)
00108     {
00109       ACE_DEBUG ((LM_DEBUG,
00110                   ACE_TEXT ("TAO (%P|%t) - %p \n"),
00111                   ACE_TEXT ("TAO - read message failure ")
00112                   ACE_TEXT ("recv () \n")));
00113     }
00114 
00115   // Error handling
00116   if (n == -1)
00117     {
00118       if (errno == EWOULDBLOCK)
00119         return 0;
00120 
00121       return -1;
00122     }
00123   // @@ What are the other error handling here??
00124   else if (n == 0)
00125     {
00126       return -1;
00127     }
00128 
00129   return n;
00130 }

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 79 of file UIOP_Transport.cpp.

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

00082 {
00083   const ssize_t retval =
00084     this->connection_handler_->peer ().sendv (iov,
00085                                               iovcnt,
00086                                               max_wait_time);
00087 
00088   if (retval > 0)
00089     bytes_transferred = retval;
00090 
00091   return retval;
00092 }

int TAO_UIOP_Transport::send_message TAO_OutputCDR stream,
TAO_Stub stub = 0,
int  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.

Implements TAO_Transport.

Definition at line 156 of file UIOP_Transport.cpp.

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

Referenced by send_request().

00160 {
00161   // Format the message in the stream first
00162   if (this->messaging_object_->format_message (stream) != 0)
00163     return -1;
00164 
00165   // Strictly speaking, should not need to loop here because the
00166   // socket never gets set to a nonblocking mode ... some Linux
00167   // versions seem to need it though.  Leaving it costs little.
00168 
00169   // This guarantees to send all data (bytes) or return an error.
00170   const ssize_t n = this->send_message_shared (stub,
00171                                                message_semantics,
00172                                                stream.begin (),
00173                                                max_wait_time);
00174 
00175   if (n == -1)
00176     {
00177       if (TAO_debug_level)
00178         ACE_DEBUG ((LM_DEBUG,
00179                     ACE_TEXT ("TAO: (%P|%t|%N|%l) closing transport %d after fault %p\n"),
00180                     this->id (),
00181                     ACE_TEXT ("send_message ()\n")));
00182 
00183       return -1;
00184     }
00185 
00186   return 1;
00187 }

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

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

Implements TAO_Transport.

Definition at line 133 of file UIOP_Transport.cpp.

References TAO_Transport::first_request_sent(), send_message(), and TAO_Wait_Strategy::sending_request().

00138 {
00139   if (this->ws_->sending_request (orb_core,
00140                                   message_semantics) == -1)
00141     return -1;
00142 
00143   if (this->send_message (stream,
00144                           stub,
00145                           message_semantics,
00146                           max_wait_time) == -1)
00147 
00148     return -1;
00149 
00150   this->first_request_sent();
00151 
00152   return 0;
00153 }


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 109 of file UIOP_Transport.h.

TAO_Pluggable_Messaging* TAO_UIOP_Transport::messaging_object_ [private]
 

Our messaging object.

Definition at line 112 of file UIOP_Transport.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:42:22 2006 for TAO_Strategies by doxygen 1.3.6