#include <UDP.h>
Inheritance diagram for TAO_AV_UDP_Transport:


Public Member Functions | |
| TAO_AV_UDP_Transport (void) | |
| TAO_AV_UDP_Transport (TAO_AV_UDP_Flow_Handler *handler) | |
| virtual | ~TAO_AV_UDP_Transport (void) |
| virtual int | open (ACE_Addr *addr) |
| 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 int | set_remote_address (const ACE_INET_Addr &address) |
| 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. | |
| TAO_AV_UDP_Flow_Handler * | handler (void) |
Protected Attributes | |
| TAO_AV_UDP_Flow_Handler * | handler_ |
| ACE_Addr * | addr_ |
| ACE_INET_Addr | peer_addr_ |
Definition at line 48 of file UDP.h.
|
|
Definition at line 162 of file UDP.cpp.
00163 :handler_ (0) 00164 { 00165 } |
|
|
Definition at line 167 of file UDP.cpp.
|
|
|
Definition at line 173 of file UDP.cpp.
00174 {
00175 }
|
|
|
Implements TAO_AV_Transport. Definition at line 191 of file UDP.cpp.
00192 {
00193 return 0;
00194 }
|
|
|
Implements TAO_AV_Transport. Definition at line 203 of file UDP.cpp.
00204 {
00205 return &this->peer_addr_;
00206 }
|
|
|
Definition at line 98 of file UDP.h.
00098 { return this->handler_; }
|
|
|
Write the complete Message_Block chain to the connection.
Implements TAO_AV_Transport. Definition at line 197 of file UDP.cpp.
00198 {
00199 return 65535;
00200 }
|
|
|
Implements TAO_AV_Transport. Definition at line 185 of file UDP.cpp.
00186 {
00187 return 0;
00188 }
|
|
||||||||||||||||
|
Read received data into the iovec buffers.
Implements TAO_AV_Transport. Definition at line 313 of file UDP.cpp. References TAO_AV_UDP_Flow_Handler::get_socket(), and ACE_SOCK_Dgram::recv().
00316 {
00317 return handler_->get_socket ()->recv (iov,this->peer_addr_,0,timeout);
00318 }
|
|
||||||||||||||||||||
|
Read len bytes from into buf using flags.
Implements TAO_AV_Transport. Definition at line 300 of file UDP.cpp. References TAO_AV_UDP_Flow_Handler::get_socket(), and ACE_SOCK_Dgram::recv().
00304 {
00305 return this->handler_->get_socket ()->recv (buf,
00306 len,
00307 this->peer_addr_,
00308 flags,
00309 timeout);
00310 }
|
|
||||||||||||||||
|
Read len bytes from into buf.
Implements TAO_AV_Transport. Definition at line 292 of file UDP.cpp. References TAO_AV_UDP_Flow_Handler::get_socket(), and ACE_SOCK_Dgram::recv().
00295 {
00296 return this->handler_->get_socket ()->recv (buf, len,this->peer_addr_);
00297 }
|
|
||||||||||||||||
|
Write the contents of iovcnt iovec's to the connection.
Implements TAO_AV_Transport. Definition at line 281 of file UDP.cpp. References TAO_AV_UDP_Flow_Handler::get_socket(), and ACE_SOCK_Dgram::send().
00284 {
00285 return this->handler_->get_socket ()->send ((const iovec *) iov,
00286 iovcnt,
00287 this->peer_addr_);
00288
00289 }
|
|
||||||||||||||||
|
Write the contents of the buffer of length len to the connection.
Implements TAO_AV_Transport. Definition at line 268 of file UDP.cpp. References ACE_DEBUG, ACE_INET_Addr::addr_to_string(), TAO_AV_UDP_Flow_Handler::get_socket(), LM_DEBUG, ACE_SOCK_Dgram::send(), and TAO_debug_level.
00271 {
00272 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Transport::send "));
00273 char addr [BUFSIZ];
00274 this->peer_addr_.addr_to_string (addr,BUFSIZ);
00275 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"to %s\n",addr));
00276
00277 return this->handler_->get_socket ()->send (buf, len,this->peer_addr_);
00278 }
|
|
||||||||||||
|
Write the complete Message_Block chain to the connection.
Implements TAO_AV_Transport. Definition at line 209 of file UDP.cpp. References ACE_IOV_MAX, ACE_Message_Block::cont(), TAO_AV_UDP_Flow_Handler::get_socket(), ACE_Message_Block::length(), ACE_Message_Block::rd_ptr(), ACE_SOCK_Dgram::send(), and ssize_t.
00210 {
00211 // For the most part this was copied from GIOP::send_request and
00212 // friends.
00213
00214 iovec iov[ACE_IOV_MAX];
00215 int iovcnt = 0;
00216 ssize_t n = 0;
00217 ssize_t nbytes = 0;
00218
00219 for (const ACE_Message_Block *i = mblk;
00220 i != 0;
00221 i = i->cont ())
00222 {
00223 // Make sure there is something to send!
00224 if (i->length () > 0)
00225 {
00226 iov[iovcnt].iov_base = i->rd_ptr ();
00227 iov[iovcnt].iov_len = static_cast<u_long> (i->length ());
00228 iovcnt++;
00229
00230 // The buffer is full make a OS call. @@ TODO this should
00231 // be optimized on a per-platform basis, for instance, some
00232 // platforms do not implement writev() there we should copy
00233 // the data into a buffer and call send_n(). In other cases
00234 // there may be some limits on the size of the iovec, there
00235 // we should set ACE_IOV_MAX to that limit.
00236 if (iovcnt == ACE_IOV_MAX)
00237 {
00238 n = this->handler_->get_socket ()->send ((const iovec *) iov,
00239 iovcnt,
00240 this->peer_addr_);
00241
00242 if (n < 1)
00243 return n;
00244
00245 nbytes += n;
00246 iovcnt = 0;
00247 }
00248 }
00249 }
00250
00251 // Check for remaining buffers to be sent!
00252 if (iovcnt != 0)
00253 {
00254 n = this->handler_->get_socket ()->send ((const iovec *) iov,
00255 iovcnt,
00256 this->peer_addr_);
00257
00258 if (n < 1)
00259 return n;
00260
00261 nbytes += n;
00262 }
00263
00264 return nbytes;
00265 }
|
|
|
Definition at line 178 of file UDP.cpp. Referenced by TAO_AV_UDP_Flow_Handler::set_remote_address().
00179 {
00180 this->peer_addr_ = address;
00181 return 0;
00182 }
|
|
|
|
|
|
|
|
|
|
1.3.6