#include <AVStreams_i.h>
Inheritance diagram for TAO_StreamEndPoint_B:
Public Member Functions | |
TAO_StreamEndPoint_B (void) | |
Constructor. | |
virtual CORBA::Boolean | multiconnect (AVStreams::streamQoS &the_qos, AVStreams::flowSpec &the_spec) |
Used for internet-style multicast. | |
virtual | ~TAO_StreamEndPoint_B (void) |
Destructor. |
Definition at line 617 of file AVStreams_i.h.
TAO_StreamEndPoint_B::TAO_StreamEndPoint_B | ( | void | ) |
Constructor.
Definition at line 2621 of file AVStreams_i.cpp.
References ACE_DEBUG, LM_DEBUG, and TAO_debug_level.
02622 { 02623 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, 02624 "\n(%P|%t) TAO_StreamEndPoint_B::TAO_StreamEndPoint_B: created")); 02625 }
TAO_StreamEndPoint_B::~TAO_StreamEndPoint_B | ( | void | ) | [virtual] |
CORBA::Boolean TAO_StreamEndPoint_B::multiconnect | ( | AVStreams::streamQoS & | the_qos, | |
AVStreams::flowSpec & | the_spec | |||
) | [virtual] |
Used for internet-style multicast.
Reimplemented from TAO_StreamEndPoint.
Definition at line 2628 of file AVStreams_i.cpp.
References CORBA::Exception::_tao_print_exception(), ACE_DEBUG, ACE_ERROR_RETURN, ACE_NEW_RETURN, TAO_AV_QoS::get_flow_qos(), TAO_Pseudo_Var_T< T >::in(), ACE_Singleton< TYPE, ACE_LOCK >::instance(), CORBA::is_nil(), LM_DEBUG, LM_ERROR, TAO_StreamEndPoint::mcast_entry_map_, TAO_AV_Connector_Registry::open(), TAO_Base_StreamEndPoint::qos(), TAO_StreamEndPoint::streamctrl_, TAO_FlowSpec_Entry::TAO_AV_DIR_IN, TAO_FlowSpec_Entry::TAO_AV_DIR_OUT, and TAO_debug_level.
02630 { 02631 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint_B::multiconnect\n")); 02632 try 02633 { 02634 int result = 0; 02635 TAO_AV_QoS qos (stream_qos); 02636 for (u_int i=0;i< flow_spec.length ();i++) 02637 { 02638 TAO_Forward_FlowSpec_Entry *forward_entry; 02639 ACE_NEW_RETURN (forward_entry, 02640 TAO_Forward_FlowSpec_Entry, 02641 0); 02642 forward_entry->parse (flow_spec[i]); 02643 ACE_CString mcast_key (forward_entry->flowname ()); 02644 AVStreams::FlowEndPoint_var flow_endpoint; 02645 if (this->fep_map_.find (mcast_key, flow_endpoint ) == 0) 02646 { 02647 AVStreams::FlowConsumer_var consumer; 02648 try 02649 { 02650 consumer = AVStreams::FlowConsumer::_narrow (flow_endpoint.in ()); 02651 } 02652 catch (const CORBA::Exception& ex) 02653 { 02654 ex._tao_print_exception ( 02655 "FlowConsumer::_narrow"); 02656 ACE_ERROR_RETURN ((LM_ERROR, "sep_b doesn't contain a flowconsumer"), 0); 02657 } 02658 AVStreams::QoS flow_qos; 02659 result = qos.get_flow_qos (forward_entry->flowname (), flow_qos); 02660 if (result < 0) 02661 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "QoS not found for %s", forward_entry->flowname ())); 02662 AVStreams::FlowConnection_var flow_connection; 02663 try 02664 { 02665 if (CORBA::is_nil (this->streamctrl_.in ())) 02666 { 02667 CORBA::Any_var streamctrl_any; 02668 streamctrl_any = this->get_property_value ("Related_StreamCtrl"); 02669 AVStreams::StreamCtrl_ptr streamctrl; 02670 streamctrl_any.in () >>= streamctrl; 02671 this->streamctrl_ = AVStreams::StreamCtrl::_duplicate (streamctrl); 02672 } 02673 CORBA::Object_var flow_connection_obj = 02674 this->streamctrl_->get_flow_connection (forward_entry->flowname ()); 02675 flow_connection = AVStreams::FlowConnection::_narrow (flow_connection_obj.in ()); 02676 } 02677 catch (const CORBA::Exception& ex) 02678 { 02679 ex._tao_print_exception ( 02680 "TAO_StreamEndPoint_B::multiconnect::get_flow_connection"); 02681 return 0; 02682 } 02683 result = flow_connection->add_consumer (consumer.in (), 02684 flow_qos); 02685 if (result == 0) 02686 ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect:add_consumer failed\n"), 0); 02687 } 02688 else 02689 { 02690 TAO_FlowSpec_Entry *mcast_entry = 0; 02691 ACE_INET_Addr *mcast_addr; 02692 mcast_addr = dynamic_cast<ACE_INET_Addr *> (forward_entry->address ()); 02693 if (mcast_addr == 0) 02694 ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect::Address missing in flowspec_entry\n"), 0); 02695 result = this->mcast_entry_map_.find (mcast_key, mcast_entry); 02696 if (result == 0) 02697 { 02698 ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect::handler already found\n"), 0); 02699 } 02700 else 02701 { 02702 switch (forward_entry->direction ()) 02703 { 02704 case TAO_FlowSpec_Entry::TAO_AV_DIR_IN: 02705 { 02706 // IN means we're the sink. 02707 // @@ We have to take care of this. 02708 // result = this->make_dgram_mcast_flow_handler (mcast_dgram); 02709 // if (result < 0) 02710 // return 0; 02711 02712 this->forward_flow_spec_set.insert (forward_entry); 02713 TAO_AV_Connector_Registry *connector_registry = TAO_AV_CORE::instance ()->connector_registry (); 02714 result = connector_registry->open (this, 02715 TAO_AV_CORE::instance (), 02716 this->forward_flow_spec_set); 02717 if (result < 0) 02718 ACE_ERROR_RETURN ((LM_ERROR, "connector_registry::open failed\n"), 0); 02719 result = this->mcast_entry_map_.bind (mcast_key, forward_entry); 02720 if (result < 0) 02721 ACE_ERROR_RETURN ((LM_ERROR, "dgram_mcast_handler::bind failed"), 0); 02722 } 02723 break; 02724 case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT: 02725 // OUT implies we're the source., which is an error. 02726 break; 02727 default: 02728 break; 02729 } 02730 } 02731 } 02732 } 02733 } 02734 catch (const CORBA::Exception& ex) 02735 { 02736 ex._tao_print_exception ( 02737 "TAO_StreamEndPoint_B::multiconnect"); 02738 return 0; 02739 } 02740 return 1; 02741 }