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)
 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
 

Constructor.

Definition at line 25 of file UIOP_Transport.cpp.

References ACE_NEW, and TAO_TAG_UIOP_PROFILE.

00027   : TAO_Transport (TAO_TAG_UIOP_PROFILE,
00028                    orb_core)
00029   , connection_handler_ (handler)
00030   , messaging_object_ (0)
00031 {
00032 
00033 /*
00034  * Hook to customize the messaging object when the concrete messaging
00035  * object is known a priori. In this case, the flag is ignored.
00036  */
00037 //@@ MESSAGING_SPL_COMMENT_HOOK_START
00038   // Use the normal GIOP object
00039   ACE_NEW (this->messaging_object_,
00040             TAO_GIOP_Message_Base (orb_core, this));
00041 //@@ MESSAGING_SPL_COMMENT_HOOK_END
00042 }

TAO_UIOP_Transport::~TAO_UIOP_Transport void   ) 
 

Default destructor.

Definition at line 44 of file UIOP_Transport.cpp.

00045 {
00046   delete this->messaging_object_;
00047 }


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

00057 {
00058   return this->connection_handler_;
00059 }

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

00051 {
00052   return this->connection_handler_;
00053 }

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

Initialising the messaging object.

Implements TAO_Transport.

Definition at line 172 of file UIOP_Transport.cpp.

References TAO_Pluggable_Messaging::init().

00174 {
00175   this->messaging_object_->init (major, minor);
00176   return 1;
00177 }

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

00063 {
00064   return this->messaging_object_;
00065 }

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

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

00085 {
00086   const ssize_t n = this->connection_handler_->peer ().recv (buf,
00087                                                              len,
00088                                                              max_wait_time);
00089 
00090   // Most of the errors handling is common for
00091   // Now the message has been read
00092   if (n == -1 &&
00093       TAO_debug_level > 4 &&
00094       errno != ETIME)
00095     {
00096       ACE_DEBUG ((LM_DEBUG,
00097                   ACE_TEXT ("TAO (%P|%t) - %p \n"),
00098                   ACE_TEXT ("TAO - read message failure ")
00099                   ACE_TEXT ("recv () \n")));
00100     }
00101 
00102   // Error handling
00103   if (n == -1)
00104     {
00105       if (errno == EWOULDBLOCK)
00106         return 0;
00107 
00108       return -1;
00109     }
00110   // @@ What are the other error handling here??
00111   else if (n == 0)
00112     {
00113       return -1;
00114     }
00115 
00116   return n;
00117 }

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

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

00071 {
00072   ssize_t const retval =
00073     this->connection_handler_->peer ().sendv (iov, iovcnt, max_wait_time);
00074 
00075   if (retval > 0)
00076     bytes_transferred = retval;
00077 
00078   return retval;
00079 }

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 138 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().

00142 {
00143   // Format the message in the stream first
00144   if (this->messaging_object_->format_message (stream) != 0)
00145     return -1;
00146 
00147   // Strictly speaking, should not need to loop here because the
00148   // socket never gets set to a nonblocking mode ... some Linux
00149   // versions seem to need it though.  Leaving it costs little.
00150 
00151   // This guarantees to send all data (bytes) or return an error.
00152   const ssize_t n = this->send_message_shared (stub,
00153                                                message_semantics,
00154                                                stream.begin (),
00155                                                max_wait_time);
00156 
00157   if (n == -1)
00158     {
00159       if (TAO_debug_level)
00160         ACE_DEBUG ((LM_DEBUG,
00161                     ACE_TEXT ("TAO: (%P|%t|%N|%l) closing transport %d after fault %p\n"),
00162                     this->id (),
00163                     ACE_TEXT ("send_message ()\n")));
00164 
00165       return -1;
00166     }
00167 
00168   return 1;
00169 }

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

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

00125 {
00126   if (this->ws_->sending_request (orb_core, message_semantics) == -1)
00127     return -1;
00128 
00129   if (this->send_message (stream, stub, message_semantics, max_wait_time) == -1)
00130     return -1;
00131 
00132   this->first_request_sent();
00133 
00134   return 0;
00135 }


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

TAO_Pluggable_Messaging* TAO_UIOP_Transport::messaging_object_ [private]
 

Our messaging object.

Definition at line 111 of file UIOP_Transport.h.


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 16:03:47 2008 for TAO_Strategies by doxygen 1.3.6