#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.
|
Constructor.
Definition at line 2589 of file AVStreams_i.cpp. References ACE_DEBUG, LM_DEBUG, and TAO_debug_level.
02590 { 02591 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, 02592 "\n(%P|%t) TAO_StreamEndPoint_B::TAO_StreamEndPoint_B: created")); 02593 } |
|
Destructor.
Definition at line 2711 of file AVStreams_i.cpp.
02712 { 02713 } |
|
Used for internet-style multicast.
Reimplemented from TAO_StreamEndPoint. Definition at line 2596 of file AVStreams_i.cpp. References ACE_CString, ACE_DEBUG, ACE_ERROR_RETURN, ACE_NEW_RETURN, TAO_FlowSpec_Entry::address(), ACE_Hash_Map_Manager_Ex< ACE_CString, TAO_FlowSpec_Entry *, ACE_Hash< ACE_CString >, ACE_Equal_To< ACE_CString >, ACE_Null_Mutex >::bind(), TAO_FlowSpec_Entry::direction(), ACE_Hash_Map_Manager_Ex< ACE_CString, TAO_FlowSpec_Entry *, ACE_Hash< ACE_CString >, ACE_Equal_To< ACE_CString >, ACE_Null_Mutex >::find(), TAO_FlowSpec_Entry::flowname(), AVStreams::flowSpec, TAO_AV_QoS::get_flow_qos(), ACE_Unbounded_Set< T >::insert(), ACE_Singleton< TYPE, ACE_LOCK >::instance(), CORBA::is_nil(), LM_DEBUG, LM_ERROR, TAO_AV_Connector_Registry::open(), TAO_Forward_FlowSpec_Entry::parse(), TAO_Base_StreamEndPoint::qos(), AVStreams::streamQoS, and TAO_debug_level.
02598 { 02599 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint_B::multiconnect\n")); 02600 try 02601 { 02602 int result = 0; 02603 TAO_AV_QoS qos (stream_qos); 02604 for (u_int i=0;i< flow_spec.length ();i++) 02605 { 02606 TAO_Forward_FlowSpec_Entry *forward_entry; 02607 ACE_NEW_RETURN (forward_entry, 02608 TAO_Forward_FlowSpec_Entry, 02609 0); 02610 forward_entry->parse (flow_spec[i]); 02611 ACE_CString mcast_key (forward_entry->flowname ()); 02612 AVStreams::FlowEndPoint_var flow_endpoint; 02613 if (this->fep_map_.find (mcast_key, flow_endpoint ) == 0) 02614 { 02615 AVStreams::FlowConsumer_var consumer; 02616 try 02617 { 02618 consumer = AVStreams::FlowConsumer::_narrow (flow_endpoint.in ()); 02619 } 02620 catch (const CORBA::Exception& ex) 02621 { 02622 ex._tao_print_exception ( 02623 "FlowConsumer::_narrow"); 02624 ACE_ERROR_RETURN ((LM_ERROR, "sep_b doesn't contain a flowconsumer"), 0); 02625 } 02626 AVStreams::QoS flow_qos; 02627 result = qos.get_flow_qos (forward_entry->flowname (), flow_qos); 02628 if (result < 0) 02629 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "QoS not found for %s", forward_entry->flowname ())); 02630 AVStreams::FlowConnection_var flow_connection; 02631 try 02632 { 02633 if (CORBA::is_nil (this->streamctrl_.in ())) 02634 { 02635 CORBA::Any_var streamctrl_any; 02636 streamctrl_any = this->get_property_value ("Related_StreamCtrl"); 02637 AVStreams::StreamCtrl_ptr streamctrl; 02638 streamctrl_any.in () >>= streamctrl; 02639 this->streamctrl_ = AVStreams::StreamCtrl::_duplicate (streamctrl); 02640 } 02641 CORBA::Object_var flow_connection_obj = 02642 this->streamctrl_->get_flow_connection (forward_entry->flowname ()); 02643 flow_connection = AVStreams::FlowConnection::_narrow (flow_connection_obj.in ()); 02644 } 02645 catch (const CORBA::Exception& ex) 02646 { 02647 ex._tao_print_exception ( 02648 "TAO_StreamEndPoint_B::multiconnect::get_flow_connection"); 02649 return 0; 02650 } 02651 result = flow_connection->add_consumer (consumer.in (), 02652 flow_qos); 02653 if (result == 0) 02654 ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect:add_consumer failed\n"), 0); 02655 } 02656 else 02657 { 02658 TAO_FlowSpec_Entry *mcast_entry = 0; 02659 ACE_INET_Addr *mcast_addr; 02660 mcast_addr = dynamic_cast<ACE_INET_Addr *> (forward_entry->address ()); 02661 if (mcast_addr == 0) 02662 ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect::Address missing in flowspec_entry\n"), 0); 02663 result = this->mcast_entry_map_.find (mcast_key, mcast_entry); 02664 if (result == 0) 02665 { 02666 ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect::handler already found\n"), 0); 02667 } 02668 else 02669 { 02670 switch (forward_entry->direction ()) 02671 { 02672 case TAO_FlowSpec_Entry::TAO_AV_DIR_IN: 02673 { 02674 // IN means we're the sink. 02675 // @@ We have to take care of this. 02676 // result = this->make_dgram_mcast_flow_handler (mcast_dgram); 02677 // if (result < 0) 02678 // return 0; 02679 02680 this->forward_flow_spec_set.insert (forward_entry); 02681 TAO_AV_Connector_Registry *connector_registry = TAO_AV_CORE::instance ()->connector_registry (); 02682 result = connector_registry->open (this, 02683 TAO_AV_CORE::instance (), 02684 this->forward_flow_spec_set); 02685 if (result < 0) 02686 ACE_ERROR_RETURN ((LM_ERROR, "connector_registry::open failed\n"), 0); 02687 result = this->mcast_entry_map_.bind (mcast_key, forward_entry); 02688 if (result < 0) 02689 ACE_ERROR_RETURN ((LM_ERROR, "dgram_mcast_handler::bind failed"), 0); 02690 } 02691 break; 02692 case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT: 02693 // OUT implies we're the source., which is an error. 02694 break; 02695 default: 02696 break; 02697 } 02698 } 02699 } 02700 } 02701 } 02702 catch (const CORBA::Exception& ex) 02703 { 02704 ex._tao_print_exception ( 02705 "TAO_StreamEndPoint_B::multiconnect"); 02706 return 0; 02707 } 02708 return 1; 02709 } |