TAO_AV_TCP_Flow_Handler Class Reference

#include <TCP.h>

Inheritance diagram for TAO_AV_TCP_Flow_Handler:

Inheritance graph
[legend]
Collaboration diagram for TAO_AV_TCP_Flow_Handler:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_AV_TCP_Flow_Handler (TAO_AV_Callback *callback=0)
virtual ~TAO_AV_TCP_Flow_Handler (void)
virtual TAO_AV_Transporttransport (void)
 get the transport.

virtual int open (void *=0)
virtual int handle_input (ACE_HANDLE fd)
virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg=0)
 Handle timeout. called from reactor.

virtual ACE_Event_Handlerevent_handler (void)
 get the underlying event handler. To be overridden by the derived clases.


Protected Attributes

TAO_AV_Coreav_core_

Constructor & Destructor Documentation

TAO_AV_TCP_Flow_Handler::TAO_AV_TCP_Flow_Handler TAO_AV_Callback callback = 0  ) 
 

Definition at line 625 of file TCP.cpp.

References ACE_NEW.

00626       :TAO_AV_Flow_Handler (callback)
00627 {
00628   ACE_NEW (this->transport_,
00629            TAO_AV_TCP_Transport (this));
00630 }

TAO_AV_TCP_Flow_Handler::~TAO_AV_TCP_Flow_Handler void   )  [virtual]
 

Definition at line 632 of file TCP.cpp.

00633 {
00634   delete this->transport_;
00635 }


Member Function Documentation

virtual ACE_Event_Handler* TAO_AV_TCP_Flow_Handler::event_handler void   )  [inline, virtual]
 

get the underlying event handler. To be overridden by the derived clases.

Implements TAO_AV_Flow_Handler.

Definition at line 116 of file TCP.h.

00116 { return this; }

int TAO_AV_TCP_Flow_Handler::handle_input ACE_HANDLE  fd  )  [virtual]
 

Reimplemented from ACE_Event_Handler.

Definition at line 689 of file TCP.cpp.

References TAO_AV_Protocol_Object::handle_input().

00690 {
00691   return this->protocol_object_->handle_input ();
00692 }

int TAO_AV_TCP_Flow_Handler::handle_timeout const ACE_Time_Value tv,
const void *  arg = 0
[virtual]
 

Handle timeout. called from reactor.

Reimplemented from TAO_AV_Flow_Handler.

Definition at line 695 of file TCP.cpp.

References TAO_AV_Flow_Handler::handle_timeout().

00697 {
00698   return TAO_AV_Flow_Handler::handle_timeout (tv,arg);
00699 }

int TAO_AV_TCP_Flow_Handler::open void *  = 0  )  [virtual]
 

Reimplemented from ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >.

Definition at line 644 of file TCP.cpp.

References ACE_DEBUG, ACE_ERROR_RETURN, ACE_NONBLOCK, ACE_TEXT(), ACE_INET_Addr::addr_to_string(), LM_DEBUG, LM_ERROR, MAXHOSTNAMELEN, ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >::peer(), ACE_Event_Handler::reactor(), ACE_Reactor::register_handler(), and TAO_debug_level.

00645 {
00646 
00647 #if defined (TCP_NODELAY)
00648   int nodelay = 1;
00649 
00650   if (this->peer ().set_option (IPPROTO_TCP,
00651                                 TCP_NODELAY,
00652                                 (void *) &nodelay,
00653                                 sizeof (nodelay)) == -1)
00654     ACE_ERROR_RETURN ((LM_ERROR,
00655                        "NODELAY failed\n"),
00656                       -1);
00657 #endif /* TCP_NODELAY */
00658 
00659   // Called by the <Strategy_Acceptor> when the handler is completely
00660   // connected.
00661   ACE_INET_Addr addr;
00662 
00663   if (this->peer ().get_remote_addr (addr) == -1)
00664     return -1;
00665 
00666   char server[MAXHOSTNAMELEN + 16];
00667 
00668   (void) addr.addr_to_string (server, sizeof (server));
00669 
00670   if (TAO_debug_level > 0)
00671     if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
00672                 "(%P|%t) connection to server <%s> on %d\n",
00673                 server, this->peer ().get_handle ()));
00674 
00675   this->peer ().enable (ACE_NONBLOCK);
00676   // Register the handler with the reactor.
00677   if (this->reactor ()
00678       && this->reactor ()->register_handler
00679       (this,
00680        ACE_Event_Handler::READ_MASK) == -1)
00681     ACE_ERROR_RETURN ((LM_ERROR,
00682                        ACE_TEXT ("%p\n"),
00683                        ACE_TEXT ("unable to register client handler")),
00684                       -1);
00685   return 0;
00686 }

TAO_AV_Transport * TAO_AV_TCP_Flow_Handler::transport void   )  [virtual]
 

get the transport.

Reimplemented from TAO_AV_Flow_Handler.

Definition at line 638 of file TCP.cpp.

Referenced by TAO_AV_TCP_Connector::connect(), TAO_AV_TCP_Acceptor::make_svc_handler(), and TAO_AV_TCP_Connector::make_svc_handler().

00639 {
00640   return this->transport_;
00641 }


Member Data Documentation

TAO_AV_Core* TAO_AV_TCP_Flow_Handler::av_core_ [protected]
 

Definition at line 118 of file TCP.h.


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