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_

Detailed Description

Definition at line 105 of file TCP.h.


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.

References TAO_AV_Flow_Handler::transport_.

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 702 of file TCP.cpp.

References TAO_AV_Protocol_Object::handle_input(), and TAO_AV_Flow_Handler::protocol_object_.

00703 {
00704   return this->protocol_object_->handle_input ();
00705 }

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 708 of file TCP.cpp.

References TAO_AV_Flow_Handler::handle_timeout().

00710 {
00711   return TAO_AV_Flow_Handler::handle_timeout (tv,arg);
00712 }

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(), IPPROTO_TCP, LM_DEBUG, LM_ERROR, MAXHOSTNAMELEN, ACE_Svc_Handler< ACE_SOCK_STREAM, ACE_NULL_SYNCH >::peer(), ACE_Event_Handler::reactor(), ACE_Event_Handler::READ_MASK, ACE_Reactor::register_handler(), SO_RCVBUF, SOL_SOCKET, TAO_debug_level, and TCP_NODELAY.

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 //begin: BJE: (allign the sizes of the buffers)
00660   int bufSize=BUFSIZ;
00661   int s= sizeof (bufSize);
00662   if(  this->peer ().get_option (SOL_SOCKET, /*IPPROTO_TCP,*/
00663                   SO_RCVBUF,
00664                                 (void *) &bufSize,&s
00665                  ) == -1)
00666        bufSize=BUFSIZ;
00667 
00668     
00669     ((TAO_AV_TCP_Object*)(this->protocol_object_))->frame_.size (bufSize);
00670 //end: BJE
00671 
00672   // Called by the <Strategy_Acceptor> when the handler is completely
00673   // connected.
00674   ACE_INET_Addr addr;
00675 
00676   if (this->peer ().get_remote_addr (addr) == -1)
00677     return -1;
00678 
00679   char server[MAXHOSTNAMELEN + 16];
00680 
00681   (void) addr.addr_to_string (server, sizeof (server));
00682 
00683   if (TAO_debug_level > 0)
00684     if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
00685                 "(%P|%t) connection to server <%s> on %d\n",
00686                 server, this->peer ().get_handle ()));
00687 
00688   this->peer ().enable (ACE_NONBLOCK);
00689   // Register the handler with the reactor.
00690   if (this->reactor ()
00691       && this->reactor ()->register_handler
00692       (this,
00693        ACE_Event_Handler::READ_MASK) == -1)
00694     ACE_ERROR_RETURN ((LM_ERROR,
00695                        ACE_TEXT ("%p\n"),
00696                        ACE_TEXT ("unable to register client handler")),
00697                       -1);
00698   return 0;
00699 }

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.

References TAO_AV_Flow_Handler::transport_.

Referenced by 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 Tue Feb 2 17:48:05 2010 for TAO_AV by  doxygen 1.4.7