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 1013 of file UDP.cpp.

References frame_, and ACE_Message_Block::size().

01015   :TAO_AV_Protocol_Object (callback,transport)
01016 {
01017   this->frame_.size (this->transport_->mtu ());
01018 }

TAO_AV_UDP_Object::~TAO_AV_UDP_Object ( void   )  [virtual]

Dtor.

Definition at line 1020 of file UDP.cpp.

01021 {
01022   //no-op
01023 }


Member Function Documentation

int TAO_AV_UDP_Object::destroy ( void   )  [virtual]

end the stream.

Implements TAO_AV_Protocol_Object.

Definition at line 1026 of file UDP.cpp.

References TAO_AV_Protocol_Object::callback_, and TAO_AV_Callback::handle_destroy().

01027 {
01028   this->callback_->handle_destroy ();
01029   delete this;
01030 
01031   return 0;
01032 }

int TAO_AV_UDP_Object::handle_input ( void   )  [virtual]

Implements TAO_AV_Protocol_Object.

Definition at line 968 of file UDP.cpp.

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

00969 {
00970   int n = this->transport_->recv (this->frame_.rd_ptr (),
00971                                   this->frame_.size ());
00972   if (n == -1)
00973     ACE_ERROR_RETURN ((LM_ERROR,"(%N,%l) TAO_AV_UDP_Flow_Handler::handle_input recv failed: errno: %m\n"),-1);
00974 
00975   this->frame_.wr_ptr (this->frame_.rd_ptr () + n);
00976 
00977   return this->callback_->receive_frame (&this->frame_);
00978 }

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

Implements TAO_AV_Protocol_Object.

Definition at line 1004 of file UDP.cpp.

References TAO_AV_Transport::send(), and TAO_AV_Protocol_Object::transport_.

01006 {
01007   int const result = this->transport_->send (buf, len, 0);
01008   if (result < 0)
01009     return result;
01010   return 0;
01011 }

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 993 of file UDP.cpp.

References TAO_AV_Transport::send(), and TAO_AV_Protocol_Object::transport_.

00996 {
00997   int const result = this->transport_->send (iov,iovcnt);
00998   if (result < 0)
00999     return result;
01000   return 0;
01001 }

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 981 of file UDP.cpp.

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

00983 {
00984   if (TAO_debug_level > 0)
00985     ACE_DEBUG ((LM_DEBUG,"TAO_AV_UDP_Object::send_frame\n"));
00986   int const result = this->transport_->send (frame);
00987   if (result < 0)
00988     return result;
00989   return 0;
00990 }


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.

Referenced by handle_input(), and TAO_AV_UDP_Object().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:48:08 2010 for TAO_AV by  doxygen 1.4.7