TAO_AV_TCP_Object Class Reference

TAO_AV_Protocol_Object for Transmission Control Protocol (TCP). More...

#include <TCP.h>

Inheritance diagram for TAO_AV_TCP_Object:

Inheritance graph
[legend]
Collaboration diagram for TAO_AV_TCP_Object:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_AV_TCP_Object (TAO_AV_Callback *callback, TAO_AV_Transport *transport=0)
virtual ~TAO_AV_TCP_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.

Public Attributes

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

Detailed Description

TAO_AV_Protocol_Object for Transmission Control Protocol (TCP).

Definition at line 226 of file TCP.h.


Constructor & Destructor Documentation

TAO_AV_TCP_Object::TAO_AV_TCP_Object ( TAO_AV_Callback callback,
TAO_AV_Transport transport = 0 
)

Definition at line 244 of file TCP.cpp.

References frame_, and ACE_Message_Block::size().

00246   :TAO_AV_Protocol_Object (callback,transport)
00247 {
00248   // @@ Is this a good size?
00249   this->frame_.size (BUFSIZ);
00250 }

TAO_AV_TCP_Object::~TAO_AV_TCP_Object ( void   )  [virtual]

Dtor.

Definition at line 252 of file TCP.cpp.

00253 {
00254   // No-op
00255 }


Member Function Documentation

int TAO_AV_TCP_Object::destroy ( void   )  [virtual]

end the stream.

Implements TAO_AV_Protocol_Object.

Definition at line 257 of file TCP.cpp.

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

00258 {
00259   this->callback_->handle_destroy ();
00260   delete this;
00261   return 0;
00262 }

int TAO_AV_TCP_Object::handle_input ( void   )  [virtual]

Implements TAO_AV_Protocol_Object.

Definition at line 206 of file TCP.cpp.

References ACE_ERROR_RETURN, TAO_AV_Protocol_Object::callback_, frame_, LM_DEBUG, 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().

00207 {
00208   int n = this->transport_->recv (this->frame_.rd_ptr (),
00209                                   this->frame_.size ());
00210   if (n == -1)
00211     ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_TCP_Flow_Handler::handle_input recv failed\n"),-1);
00212   if (n == 0)
00213     ACE_ERROR_RETURN ((LM_DEBUG,"TAO_AV_TCP_Flow_Handler::handle_input connection closed\n"),-1);
00214   this->frame_.wr_ptr (this->frame_.rd_ptr () + n);
00215 
00216   return this->callback_->receive_frame (&this->frame_);
00217 }

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

Implements TAO_AV_Protocol_Object.

Definition at line 236 of file TCP.cpp.

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

00238 {
00239   int result = this->transport_->send (buf, len, 0);
00240   return result;
00241 }

int TAO_AV_TCP_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 228 of file TCP.cpp.

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

00231 {
00232   return this->transport_->send (iov,iovcnt);
00233 }

int TAO_AV_TCP_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 220 of file TCP.cpp.

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

00222 {
00223   int result = this->transport_->send (frame);
00224   return result;
00225 }


Member Data Documentation

ACE_Message_Block TAO_AV_TCP_Object::frame_

Pre-allocated memory to receive the data...

Definition at line 253 of file TCP.h.

Referenced by handle_input(), and TAO_AV_TCP_Object().


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