TAO_AV_TCP_Connector Class Reference

#include <TCP.h>

Inheritance diagram for TAO_AV_TCP_Connector:

Inheritance graph
[legend]
Collaboration diagram for TAO_AV_TCP_Connector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_AV_TCP_Connector (void)
virtual ~TAO_AV_TCP_Connector (void)
virtual int open (TAO_Base_StreamEndPoint *endpoint, TAO_AV_Core *av_core, TAO_AV_Flow_Protocol_Factory *factory)
virtual int connect (TAO_FlowSpec_Entry *entry, TAO_AV_Transport *&transport, TAO_AV_Core::Flow_Component flow_comp=TAO_AV_Core::TAO_AV_DATA)
virtual int close (void)
virtual int make_svc_handler (TAO_AV_TCP_Flow_Handler *&handler)

Protected Attributes

TAO_AV_Coreav_core_
TAO_AV_TCP_Base_Connector connector_
TAO_Base_StreamEndPointendpoint_
TAO_FlowSpec_Entryentry_
TAO_AV_Flow_Protocol_Factoryflow_protocol_factory_

Detailed Description

Definition at line 198 of file TCP.h.


Constructor & Destructor Documentation

TAO_AV_TCP_Connector::TAO_AV_TCP_Connector ( void   ) 

Definition at line 360 of file TCP.cpp.

00361 {
00362 }

TAO_AV_TCP_Connector::~TAO_AV_TCP_Connector ( void   )  [virtual]

Definition at line 364 of file TCP.cpp.

00365 {
00366 }


Member Function Documentation

int TAO_AV_TCP_Connector::close ( void   )  [virtual]

Implements TAO_AV_Connector.

Definition at line 434 of file TCP.cpp.

00435 {
00436   return 0;
00437 }

int TAO_AV_TCP_Connector::connect ( TAO_FlowSpec_Entry entry,
TAO_AV_Transport *&  transport,
TAO_AV_Core::Flow_Component  flow_comp = TAO_AV_Core::TAO_AV_DATA 
) [virtual]

Implements TAO_AV_Connector.

Definition at line 412 of file TCP.cpp.

References ACE_ERROR_RETURN, TAO_FlowSpec_Entry::address(), connector_, TAO_AV_TCP_Base_Connector::connector_connect(), entry_, TAO_FlowSpec_Entry::flowname(), TAO_AV_Connector::flowname_, TAO_AV_Core::get_control_flowname(), TAO_FlowSpec_Entry::handler(), inet_addr(), LM_ERROR, and TAO_AV_Core::TAO_AV_CONTROL.

00415 {
00416   this->entry_ = entry;
00417   if (flow_comp == TAO_AV_Core::TAO_AV_CONTROL)
00418     this->flowname_ = TAO_AV_Core::get_control_flowname (entry->flowname ());
00419   else
00420   this->flowname_ = entry->flowname ();
00421   ACE_Addr *remote_addr = entry->address ();
00422   ACE_INET_Addr *inet_addr = dynamic_cast<ACE_INET_Addr *> (remote_addr);
00423   TAO_AV_TCP_Flow_Handler *handler = 0;
00424   int result = this->connector_.connector_connect (handler,
00425                                                    *inet_addr);
00426   if (result < 0)
00427     ACE_ERROR_RETURN ((LM_ERROR,"TAO_AV_TCP_connector::connect failed\n"),-1);
00428   entry->handler (handler);
00429   transport = handler->transport ();
00430   return 0;
00431 }

int TAO_AV_TCP_Connector::make_svc_handler ( TAO_AV_TCP_Flow_Handler *&  handler  )  [virtual]

Definition at line 369 of file TCP.cpp.

References ACE_DEBUG, ACE_NEW_RETURN, endpoint_, entry_, flow_protocol_factory_, TAO_FlowSpec_Entry::handler(), LM_DEBUG, TAO_AV_Flow_Protocol_Factory::make_protocol_object(), TAO_FlowSpec_Entry::protocol_object(), TAO_AV_Flow_Handler::protocol_object(), TAO_Base_StreamEndPoint::set_flow_handler(), TAO_debug_level, and TAO_AV_TCP_Flow_Handler::transport().

Referenced by TAO_AV_TCP_Base_Connector::make_svc_handler().

00370 {
00371   if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_TCP_Connector::make_svc_handler\n"));
00372   //  TAO_AV_Callback *callback = 0;
00373   if (this->endpoint_ != 0)
00374     {
00375 //       this->endpoint_->get_callback (this->flowname_.c_str (),
00376 //                                      callback);
00377       ACE_NEW_RETURN (tcp_handler,
00378                       //                      TAO_AV_TCP_Flow_Handler (callback),
00379                       TAO_AV_TCP_Flow_Handler,
00380                       -1);
00381       TAO_AV_Protocol_Object *object =
00382         this->flow_protocol_factory_->make_protocol_object (this->entry_,
00383                                                             this->endpoint_,
00384                                                             tcp_handler,
00385                                                             tcp_handler->transport ());
00386       tcp_handler->protocol_object (object);
00387       //      callback->protocol_object (object);
00388 //       this->endpoint_->set_protocol_object (this->flowname_.c_str (),
00389 //                                             object);
00390       this->endpoint_->set_flow_handler (this->flowname_.c_str (),tcp_handler);
00391       this->entry_->protocol_object (object);
00392       this->entry_->handler (tcp_handler);
00393     }
00394   return 0;
00395 }

int TAO_AV_TCP_Connector::open ( TAO_Base_StreamEndPoint endpoint,
TAO_AV_Core av_core,
TAO_AV_Flow_Protocol_Factory factory 
) [virtual]

Implements TAO_AV_Connector.

Definition at line 398 of file TCP.cpp.

References ACE_DEBUG, connector_, TAO_AV_TCP_Base_Connector::connector_open(), endpoint_, flow_protocol_factory_, LM_DEBUG, TAO_AV_Core::reactor(), and TAO_debug_level.

00402 {
00403   this->endpoint_ = endpoint;
00404   this->flow_protocol_factory_ = factory;
00405   if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_TCP_Connector::open "));
00406   int result = this->connector_.connector_open(this,
00407                                                av_core->reactor ());
00408   return result;
00409 }


Member Data Documentation

TAO_AV_Core* TAO_AV_TCP_Connector::av_core_ [protected]

Definition at line 215 of file TCP.h.

TAO_AV_TCP_Base_Connector TAO_AV_TCP_Connector::connector_ [protected]

Definition at line 216 of file TCP.h.

Referenced by connect(), and open().

TAO_Base_StreamEndPoint* TAO_AV_TCP_Connector::endpoint_ [protected]

Definition at line 217 of file TCP.h.

Referenced by make_svc_handler(), and open().

TAO_FlowSpec_Entry* TAO_AV_TCP_Connector::entry_ [protected]

Definition at line 218 of file TCP.h.

Referenced by connect(), and make_svc_handler().

TAO_AV_Flow_Protocol_Factory* TAO_AV_TCP_Connector::flow_protocol_factory_ [protected]

Definition at line 219 of file TCP.h.

Referenced by make_svc_handler(), and open().


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