TAO_AV_UDP_Object Class Reference

TAO_AV_Protocol_Object for the User Datagram Protocol (UDP). More...

#include <UDP.h>

Inheritance diagram for TAO_AV_UDP_Object:

Inheritance graph
[legend]
Collaboration diagram for TAO_AV_UDP_Object:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_AV_UDP_Object (TAO_AV_Callback *callback, TAO_AV_Transport *transport=0)
virtual ~TAO_AV_UDP_Object (void)
 Dtor.

virtual int handle_input (void)
virtual int send_frame (ACE_Message_Block *frame, TAO_AV_frame_info *frame_info=0)
 send a data frame.

virtual int send_frame (const iovec *iov, int iovcnt, TAO_AV_frame_info *frame_info=0)
 send a frame in iovecs.

virtual int send_frame (const char *buf, size_t len)
virtual int destroy (void)
 end the stream.


Private Attributes

ACE_Message_Block frame_
 Pre-allocated memory to receive the data...


Detailed Description

TAO_AV_Protocol_Object for the User Datagram Protocol (UDP).

Definition at line 233 of file UDP.h.


Constructor & Destructor Documentation

TAO_AV_UDP_Object::TAO_AV_UDP_Object TAO_AV_Callback callback,
TAO_AV_Transport transport = 0
 

Definition at line 1002 of file UDP.cpp.

References ACE_Message_Block::size().

01004   :TAO_AV_Protocol_Object (callback,transport)
01005 {
01006   this->frame_.size (this->transport_->mtu ());
01007 }

TAO_AV_UDP_Object::~TAO_AV_UDP_Object void   )  [virtual]
 

Dtor.

Definition at line 1009 of file UDP.cpp.

01010 {
01011   //no-op
01012 }


Member Function Documentation

int TAO_AV_UDP_Object::destroy void   )  [virtual]
 

end the stream.

Implements TAO_AV_Protocol_Object.

Definition at line 1015 of file UDP.cpp.

References TAO_AV_Callback::handle_destroy().

01016 {
01017   this->callback_->handle_destroy ();
01018   delete this;
01019 
01020   return 0;
01021 }

int TAO_AV_UDP_Object::handle_input void   )  [virtual]
 

Implements TAO_AV_Protocol_Object.

Definition at line 958 of file UDP.cpp.

References ACE_ERROR_RETURN, LM_ERROR, TAO_AV_Callback::receive_frame(), TAO_AV_Transport::recv(), ACE_Message_Block::size(), and ACE_Message_Block::wr_ptr().

00959 {
00960   int n = this->transport_->recv (this->frame_.rd_ptr (),
00961                                   this->frame_.size ());
00962   if (n == -1)
00963     ACE_ERROR_RETURN ((LM_ERROR,"(%N,%l) TAO_AV_UDP_Flow_Handler::handle_input recv failed: errno: %m\n"),-1);
00964 
00965   this->frame_.wr_ptr (this->frame_.rd_ptr () + n);
00966 
00967   return this->callback_->receive_frame (&this->frame_);
00968 }

int TAO_AV_UDP_Object::send_frame const char *  buf,
size_t  len
[virtual]
 

Implements TAO_AV_Protocol_Object.

Definition at line 993 of file UDP.cpp.

References TAO_AV_Transport::send().

00995 {
00996   int result = this->transport_->send (buf, len, 0);
00997   if (result < 0)
00998     return result;
00999   return 0;
01000 }

int TAO_AV_UDP_Object::send_frame const iovec iov,
int  iovcnt,
TAO_AV_frame_info frame_info = 0
[virtual]
 

send a frame in iovecs.

Implements TAO_AV_Protocol_Object.

Definition at line 982 of file UDP.cpp.

References TAO_AV_Transport::send().

00985 {
00986   int result = this->transport_->send (iov,iovcnt);
00987   if (result < 0)
00988     return result;
00989   return 0;
00990 }

int TAO_AV_UDP_Object::send_frame ACE_Message_Block frame,
TAO_AV_frame_info frame_info = 0
[virtual]
 

send a data frame.

Implements TAO_AV_Protocol_Object.

Definition at line 971 of file UDP.cpp.

References ACE_DEBUG, LM_DEBUG, TAO_AV_Transport::send(), and TAO_debug_level.

00973 {
00974   if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Object::send_frame\n"));
00975   int result = this->transport_->send (frame);
00976   if (result < 0)
00977     return result;
00978   return 0;
00979 }


Member Data Documentation

ACE_Message_Block TAO_AV_UDP_Object::frame_ [private]
 

Pre-allocated memory to receive the data...

Definition at line 260 of file UDP.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:48:24 2006 for TAO_AV by doxygen 1.3.6