#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.
|
Definition at line 15 of file TCP.cpp.
00016 :handler_ (0) 00017 { 00018 } |
|
Definition at line 20 of file TCP.cpp.
00021 :handler_ (handler) 00022 { 00023 } |
|
Definition at line 25 of file TCP.cpp.
00026 { 00027 } |
|
Implements TAO_AV_Transport. Definition at line 36 of file TCP.cpp.
00037 {
00038 return 0;
00039 }
|
|
Implements TAO_AV_Transport. Definition at line 48 of file TCP.cpp.
00049 {
00050 return 0;
00051 }
|
|
Write the complete Message_Block chain to the connection.
Implements TAO_AV_Transport. Definition at line 42 of file TCP.cpp.
00043 {
00044 return -1;
00045 }
|
|
Implements TAO_AV_Transport. Definition at line 30 of file TCP.cpp.
00031 {
00032 return 0;
00033 }
|
|
Read received data into the iovec buffers.
Implements TAO_AV_Transport. Definition at line 145 of file TCP.cpp. References ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >::peer().
|
|
Read len bytes from into buf using flags.
Implements TAO_AV_Transport. Definition at line 134 of file TCP.cpp. References ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >::peer().
|
|
Read len bytes from into buf.
Implements TAO_AV_Transport. Definition at line 126 of file TCP.cpp. References ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >::peer().
|
|
Write the contents of iovcnt iovec's to the connection.
Implements TAO_AV_Transport. Definition at line 117 of file TCP.cpp. References ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >::peer().
|
|
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 ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >::peer().
|
|
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(), iovec::iov_base, iovec::iov_len, ACE_Message_Block::length(), ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >::peer(), ACE_Message_Block::rd_ptr(), and ssize_t.
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 } |
|
|