Specialization of the base TAO_Transport class to handle the UIOP protocol. More...
#include <UIOP_Transport.h>
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_Handler * | connection_handler_ |
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_TWOWAY_REQUEST, ACE_Time_Value *max_time_wait=0) |
virtual ACE_Event_Handler * | event_handler_i (void) |
virtual TAO_Connection_Handler * | connection_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. |
Specialization of the base TAO_Transport class to handle the UIOP protocol.
Definition at line 51 of file UIOP_Transport.h.
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.
: TAO_Transport (TAO_TAG_UIOP_PROFILE, orb_core) , connection_handler_ (handler) { }
TAO_UIOP_Transport::~TAO_UIOP_Transport | ( | void | ) |
TAO_Connection_Handler * TAO_UIOP_Transport::connection_handler_i | ( | void | ) | [protected, virtual] |
Implements TAO_Transport.
Definition at line 44 of file UIOP_Transport.cpp.
{ return this->connection_handler_; }
ACE_Event_Handler * TAO_UIOP_Transport::event_handler_i | ( | void | ) | [protected, virtual] |
Implements TAO_Transport.
Definition at line 38 of file UIOP_Transport.cpp.
{ return this->connection_handler_; }
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.
{ const ssize_t n = this->connection_handler_->peer ().recv (buf, len, max_wait_time); // Most of the errors handling is common for // Now the message has been read if (n == -1 && TAO_debug_level > 4 && errno != ETIME) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) - UIOP_Transport::recv, %p %p\n"), ACE_TEXT ("TAO - read message failure ") ACE_TEXT ("recv ()\n"))); } // Error handling if (n == -1) { if (errno == EWOULDBLOCK) return 0; return -1; } // @@ What are the other error handling here?? else if (n == 0) { return -1; } return n; }
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.
{ ssize_t const retval = this->connection_handler_->peer ().sendv (iov, iovcnt, max_wait_time); if (retval > 0) bytes_transferred = retval; return retval; }
int TAO_UIOP_Transport::send_message | ( | TAO_OutputCDR & | stream, | |
TAO_Stub * | stub = 0 , |
|||
TAO_Message_Semantics | message_semantics = TAO_TWOWAY_REQUEST , |
|||
ACE_Time_Value * | max_time_wait = 0 | |||
) | [virtual] |
Implements TAO_Transport.
Definition at line 120 of file UIOP_Transport.cpp.
{ // Format the message in the stream first if (this->messaging_object ()->format_message (stream, stub) != 0) return -1; // Strictly speaking, should not need to loop here because the // socket never gets set to a nonblocking mode ... some Linux // versions seem to need it though. Leaving it costs little. // This guarantees to send all data (bytes) or return an error. const ssize_t n = this->send_message_shared (stub, message_semantics, stream.begin (), max_wait_time); if (n == -1) { if (TAO_debug_level) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO (%P|%t) closing transport %d after fault %p\n"), this->id (), ACE_TEXT ("send_message ()\n"))); return -1; } return 1; }
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] |
Implements TAO_Transport.
Definition at line 102 of file UIOP_Transport.cpp.
{ if (this->ws_->sending_request (orb_core, message_semantics) == -1) return -1; if (this->send_message (stream, stub, message_semantics, max_wait_time) == -1) return -1; this->first_request_sent(); return 0; }
The connection service handler used for accessing lower layer communication protocols.
Definition at line 101 of file UIOP_Transport.h.