#include <TCP.h>
Inheritance diagram for TAO_AV_TCP_Transport:
Public Member Functions | |
TAO_AV_TCP_Transport (void) | |
TAO_AV_TCP_Transport (TAO_AV_TCP_Flow_Handler *handler) | |
virtual | ~TAO_AV_TCP_Transport (void) |
virtual int | open (ACE_Addr *address) |
virtual int | close (void) |
virtual int | mtu (void) |
Write the complete Message_Block chain to the connection. | |
virtual ACE_Addr * | get_peer_addr (void) |
virtual ssize_t | send (const ACE_Message_Block *mblk, ACE_Time_Value *s=0) |
Write the complete Message_Block chain to the connection. | |
virtual ssize_t | send (const char *buf, size_t len, ACE_Time_Value *s=0) |
Write the contents of the buffer of length len to the connection. | |
virtual ssize_t | send (const iovec *iov, int iovcnt, ACE_Time_Value *s=0) |
Write the contents of iovcnt iovec's to the connection. | |
virtual ssize_t | recv (char *buf, size_t len, ACE_Time_Value *s=0) |
Read len bytes from into buf. | |
virtual ssize_t | recv (char *buf, size_t len, int flags, ACE_Time_Value *s=0) |
Read len bytes from into buf using flags. | |
virtual ssize_t | recv (iovec *iov, int iovcnt, ACE_Time_Value *s=0) |
Read received data into the iovec buffers. | |
Protected Attributes | |
TAO_AV_TCP_Flow_Handler * | handler_ |
Definition at line 49 of file TCP.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_AV_TCP_Transport::TAO_AV_TCP_Transport | ( | void | ) |
TAO_AV_TCP_Transport::TAO_AV_TCP_Transport | ( | TAO_AV_TCP_Flow_Handler * | handler | ) |
TAO_AV_TCP_Transport::~TAO_AV_TCP_Transport | ( | void | ) | [virtual] |
int TAO_AV_TCP_Transport::close | ( | void | ) | [virtual] |
ACE_Addr * TAO_AV_TCP_Transport::get_peer_addr | ( | void | ) | [virtual] |
int TAO_AV_TCP_Transport::mtu | ( | void | ) | [virtual] |
Write the complete Message_Block chain to the connection.
Implements TAO_AV_Transport.
Definition at line 42 of file TCP.cpp.
int TAO_AV_TCP_Transport::open | ( | ACE_Addr * | address | ) | [virtual] |
ssize_t TAO_AV_TCP_Transport::recv | ( | iovec * | iov, | |
int | iovcnt, | |||
ACE_Time_Value * | s = 0 | |||
) | [virtual] |
Read received data into the iovec buffers.
Implements TAO_AV_Transport.
Definition at line 145 of file TCP.cpp.
References handler_, and ACE_Svc_Handler<, >::peer().
ssize_t TAO_AV_TCP_Transport::recv | ( | char * | buf, | |
size_t | len, | |||
int | flags, | |||
ACE_Time_Value * | s = 0 | |||
) | [virtual] |
Read len bytes from into buf using flags.
Implements TAO_AV_Transport.
Definition at line 134 of file TCP.cpp.
References handler_, and ACE_Svc_Handler<, >::peer().
ssize_t TAO_AV_TCP_Transport::recv | ( | char * | buf, | |
size_t | len, | |||
ACE_Time_Value * | s = 0 | |||
) | [virtual] |
Read len bytes from into buf.
Implements TAO_AV_Transport.
Definition at line 126 of file TCP.cpp.
References handler_, and ACE_Svc_Handler<, >::peer().
ssize_t TAO_AV_TCP_Transport::send | ( | const iovec * | iov, | |
int | iovcnt, | |||
ACE_Time_Value * | s = 0 | |||
) | [virtual] |
Write the contents of iovcnt iovec's to the connection.
Implements TAO_AV_Transport.
Definition at line 117 of file TCP.cpp.
References handler_, and ACE_Svc_Handler<, >::peer().
ssize_t TAO_AV_TCP_Transport::send | ( | const char * | buf, | |
size_t | len, | |||
ACE_Time_Value * | s = 0 | |||
) | [virtual] |
Write the contents of the buffer of length len to the connection.
Implements TAO_AV_Transport.
Definition at line 109 of file TCP.cpp.
References handler_, and ACE_Svc_Handler<, >::peer().
ssize_t TAO_AV_TCP_Transport::send | ( | const ACE_Message_Block * | mblk, | |
ACE_Time_Value * | s = 0 | |||
) | [virtual] |
Write the complete Message_Block chain to the connection.
Implements TAO_AV_Transport.
Definition at line 54 of file TCP.cpp.
References ACE_IOV_MAX, ACE_Message_Block::cont(), handler_, and ACE_Svc_Handler<, >::peer().
00055 { 00056 // For the most part this was copied from GIOP::send_request and 00057 // friends. 00058 00059 iovec iov[ACE_IOV_MAX]; 00060 int iovcnt = 0; 00061 ssize_t n = 0; 00062 ssize_t nbytes = 0; 00063 00064 for (const ACE_Message_Block *i = mblk; 00065 i != 0; 00066 i = i->cont ()) 00067 { 00068 // Make sure there is something to send! 00069 if (i->length () > 0) 00070 { 00071 iov[iovcnt].iov_base = i->rd_ptr (); 00072 iov[iovcnt].iov_len = static_cast<u_long> (i->length ()); 00073 iovcnt++; 00074 00075 // The buffer is full make a OS call. @@ TODO this should 00076 // be optimized on a per-platform basis, for instance, some 00077 // platforms do not implement writev() there we should copy 00078 // the data into a buffer and call send_n(). In other cases 00079 // there may be some limits on the size of the iovec, there 00080 // we should set ACE_IOV_MAX to that limit. 00081 if (iovcnt == ACE_IOV_MAX) 00082 { 00083 n = this->handler_->peer ().sendv_n ((const iovec *) iov, 00084 iovcnt); 00085 if (n < 1) 00086 return n; 00087 00088 nbytes += n; 00089 iovcnt = 0; 00090 } 00091 } 00092 } 00093 00094 // Check for remaining buffers to be sent! 00095 if (iovcnt != 0) 00096 { 00097 n = this->handler_->peer ().sendv_n ((const iovec *) iov, 00098 iovcnt); 00099 if (n < 1) 00100 return n; 00101 00102 nbytes += n; 00103 } 00104 00105 return nbytes; 00106 }
TAO_AV_TCP_Flow_Handler* TAO_AV_TCP_Transport::handler_ [protected] |