Public Member Functions

TAO_StreamEndPoint_B Class Reference

The "B" side of a streamendpoint. More...

#include <AVStreams_i.h>

Inheritance diagram for TAO_StreamEndPoint_B:
Inheritance graph
[legend]
Collaboration diagram for TAO_StreamEndPoint_B:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

The "B" side of a streamendpoint.

Definition at line 617 of file AVStreams_i.h.


Constructor & Destructor Documentation

TAO_StreamEndPoint_B::TAO_StreamEndPoint_B ( void   ) 

Constructor.

Definition at line 2622 of file AVStreams_i.cpp.

{
  if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
                                       "\n(%P|%t) TAO_StreamEndPoint_B::TAO_StreamEndPoint_B: created"));
}

TAO_StreamEndPoint_B::~TAO_StreamEndPoint_B ( void   )  [virtual]

Destructor.

Definition at line 2744 of file AVStreams_i.cpp.

{
}


Member Function Documentation

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 2629 of file AVStreams_i.cpp.

{
  if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "TAO_StreamEndPoint_B::multiconnect\n"));
  try
    {
      int result = 0;
      TAO_AV_QoS qos (stream_qos);
      for (u_int i=0;i< flow_spec.length ();i++)
        {
          TAO_Forward_FlowSpec_Entry *forward_entry;
          ACE_NEW_RETURN (forward_entry,
                          TAO_Forward_FlowSpec_Entry,
                          0);
          forward_entry->parse (flow_spec[i]);
          ACE_CString mcast_key (forward_entry->flowname ());
          AVStreams::FlowEndPoint_var flow_endpoint;
          if (this->fep_map_.find (mcast_key, flow_endpoint ) == 0)
            {
              AVStreams::FlowConsumer_var consumer;
              try
                {
                  consumer = AVStreams::FlowConsumer::_narrow (flow_endpoint.in ());
                }
              catch (const CORBA::Exception& ex)
                {
                  ex._tao_print_exception (
                    "FlowConsumer::_narrow");
                  ACE_ERROR_RETURN ((LM_ERROR, "sep_b doesn't contain a flowconsumer"), 0);
                }
              AVStreams::QoS flow_qos;
              result = qos.get_flow_qos (forward_entry->flowname (), flow_qos);
              if (result < 0)
                if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "QoS not found for %s", forward_entry->flowname ()));
              AVStreams::FlowConnection_var flow_connection;
              try
                {
                  if (CORBA::is_nil (this->streamctrl_.in ()))
                    {
                      CORBA::Any_var streamctrl_any;
                      streamctrl_any = this->get_property_value ("Related_StreamCtrl");
                      AVStreams::StreamCtrl_ptr streamctrl;
                      streamctrl_any.in () >>= streamctrl;
                      this->streamctrl_ = AVStreams::StreamCtrl::_duplicate (streamctrl);
                    }
                  CORBA::Object_var flow_connection_obj =
                    this->streamctrl_->get_flow_connection (forward_entry->flowname ());
                  flow_connection = AVStreams::FlowConnection::_narrow (flow_connection_obj.in ());
                }
              catch (const CORBA::Exception& ex)
                {
                  ex._tao_print_exception (
                    "TAO_StreamEndPoint_B::multiconnect::get_flow_connection");
                  return 0;
                }
              result = flow_connection->add_consumer (consumer.in (),
                                                      flow_qos);
              if (result == 0)
                ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect:add_consumer failed\n"), 0);
            }
          else
            {
              TAO_FlowSpec_Entry *mcast_entry = 0;
              ACE_INET_Addr *mcast_addr;
              mcast_addr = dynamic_cast<ACE_INET_Addr *> (forward_entry->address ());
              if (mcast_addr == 0)
                ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect::Address missing in flowspec_entry\n"), 0);
              result = this->mcast_entry_map_.find (mcast_key, mcast_entry);
              if (result == 0)
                {
                  ACE_ERROR_RETURN ((LM_ERROR, "TAO_StreamEndPoint_B::multiconnect::handler already found\n"), 0);
                }
              else
                {
                  switch (forward_entry->direction ())
                    {
                    case TAO_FlowSpec_Entry::TAO_AV_DIR_IN:
                      {
                        // IN means we're the sink.
                        // @@ We have to take care of this.
                        //                 result = this->make_dgram_mcast_flow_handler (mcast_dgram);
                        //                 if (result < 0)
                        //                   return 0;

                        this->forward_flow_spec_set.insert (forward_entry);
                        TAO_AV_Connector_Registry *connector_registry = TAO_AV_CORE::instance ()->connector_registry ();
                        result = connector_registry->open (this,
                                                           TAO_AV_CORE::instance (),
                                                           this->forward_flow_spec_set);
                        if (result < 0)
                          ACE_ERROR_RETURN ((LM_ERROR, "connector_registry::open failed\n"), 0);
                        result = this->mcast_entry_map_.bind (mcast_key, forward_entry);
                        if (result < 0)
                          ACE_ERROR_RETURN ((LM_ERROR, "dgram_mcast_handler::bind failed"), 0);
                      }
                      break;
                    case TAO_FlowSpec_Entry::TAO_AV_DIR_OUT:
                      // OUT implies we're the source., which is an error.
                      break;
                    default:
                      break;
                    }
                }
            }
        }
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception (
        "TAO_StreamEndPoint_B::multiconnect");
      return 0;
    }
  return 1;
}


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines