summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/PortableGroup
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2012-08-08 15:31:24 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2012-08-08 15:31:24 +0000
commiteb186678ce78f75fe546a5281ea8640dd13d6521 (patch)
tree9671ba00bf3610dff414b18b6c5e939e66d46263 /TAO/orbsvcs/orbsvcs/PortableGroup
parent91c08a20d1db5a6639cedeef23dbed3bbedd97c2 (diff)
downloadATCD-eb186678ce78f75fe546a5281ea8640dd13d6521.tar.gz
Wed Aug 8 15:30:00 UTC 2012 Simon Massey <sma at prismtech dot com>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/PortableGroup')
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp15
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h4
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp8
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp66
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp93
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h22
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.inl7
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp31
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h3
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.h7
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp19
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp4
13 files changed, 290 insertions, 38 deletions
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp
index 818ee4c1eb8..fc27fb18ddd 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.cpp
@@ -19,14 +19,15 @@
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-TAO_UIPMC_Acceptor::TAO_UIPMC_Acceptor (void)
+TAO_UIPMC_Acceptor::TAO_UIPMC_Acceptor (bool listen_on_all_ifs)
: TAO_Acceptor (IOP::TAG_UIPMC),
addrs_ (0),
hosts_ (0),
endpoint_count_ (0),
version_ (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR),
orb_core_ (0),
- connection_handler_ (0)
+ connection_handler_ (0),
+ listen_on_all_(listen_on_all_ifs)
{
}
@@ -234,7 +235,15 @@ TAO_UIPMC_Acceptor::open_i (const ACE_INET_Addr& addr,
-1);
this->connection_handler_->local_addr (addr);
- this->connection_handler_->open (0);
+ this->connection_handler_->listen_on_all (this->listen_on_all_);
+ if (this->connection_handler_->open (0))
+ {
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT("TAO (%P|%t) - TAO_UIPMC_Acceptor::open_i, ")
+ ACE_TEXT("failed to open connection handler.\n")
+ ));
+ return -1;
+ }
int result =
reactor->register_handler (this->connection_handler_,
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h
index e66f18ff5a7..13acbf67da8 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Acceptor.h
@@ -47,7 +47,7 @@ class TAO_PortableGroup_Export TAO_UIPMC_Acceptor : public TAO_Acceptor
{
public:
/// Constructor.
- TAO_UIPMC_Acceptor (void);
+ TAO_UIPMC_Acceptor (bool listen_on_all_ifs);
/// Destructor.
~TAO_UIPMC_Acceptor (void);
@@ -148,6 +148,8 @@ protected:
private:
TAO_UIPMC_Mcast_Connection_Handler *connection_handler_;
+
+ bool listen_on_all_;
};
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
index 70b68065b90..3127c8fae25 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connection_Handler.cpp
@@ -199,7 +199,7 @@ TAO_UIPMC_Connection_Handler::open (void*)
static_cast<DWORD> (protocol_properties.enable_multicast_loop_);
#elif defined (ACE_HAS_IPV6_MULTICAST_LOOP_AS_BOOL)
bool enable_loop =
- static_cast<bool> (protocol_properties.enable_multicast_loop_);
+ static_cast<bool> (protocol_properties.enable_multicast_loop_);
#else
unsigned int enable_loop =
static_cast<unsigned int> (protocol_properties.enable_multicast_loop_);
@@ -236,9 +236,11 @@ TAO_UIPMC_Connection_Handler::open (void*)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT("TAO (%P|%t) - UIPMC_Connection_Handler::open, ")
- ACE_TEXT("couldn't %s multicast packets looping\n\n"),
+ ACE_TEXT("couldn't %s multicast packets looping %p\n"),
protocol_properties.enable_multicast_loop_ ?
- ACE_TEXT("enable") : ACE_TEXT("disable")));
+ ACE_TEXT("enable") : ACE_TEXT("disable"),
+ ACE_TEXT("errno")
+ ));
}
return -1;
}
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp
index 212f03bc30e..68b1717f790 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Connector.cpp
@@ -129,18 +129,64 @@ TAO_UIPMC_Connector::make_connection (TAO::Profile_Transport_Resolver *,
u_short port = 0;
const ACE_UINT32 ia_any = INADDR_ANY;
- ACE_INET_Addr local_addr(port, ia_any);
+ ACE_INET_Addr any_addr(port, ia_any);
#if defined (ACE_HAS_IPV6)
if (remote_address.get_type () == AF_INET6)
- local_addr.set (port,
- ACE_IPV6_ANY);
+ any_addr.set (port,
+ ACE_IPV6_ANY);
#endif /* ACE_HAS_IPV6 */
-
- svc_handler->local_addr (local_addr);
+ ACE_INET_Addr local_addr(any_addr);
svc_handler->addr (remote_address);
- int retval = svc_handler->open (0);
+ int retval = 0;
+
+ while (uipmc_endpoint != 0)
+ {
+ if (uipmc_endpoint->is_preferred_network ())
+ {
+ local_addr.set(port, uipmc_endpoint->preferred_network ());
+ }
+ else
+ {
+ local_addr.set(any_addr);
+ }
+ svc_handler->local_addr (local_addr);
+ retval = svc_handler->open (0);
+ if (retval == 0)
+ {
+#if defined (ACE_HAS_IPV6)
+ const char* prefer_if = uipmc_endpoint->preferred_if();
+ if (prefer_if && ACE_OS::strlen(prefer_if))
+ {
+ if (svc_handler->peer ().set_nic(prefer_if, AF_INET6))
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - UIPMC_Connector::make_connection, "
+ "connection to <%C:%u> - failed to set requested local network interface <%s>\n",
+ uipmc_endpoint->host (),
+ uipmc_endpoint->port (),
+ prefer_if));
+ retval = -1;
+ }
+ }
+#endif /* ACE_HAS_IPV6 */
+ break;
+ }
+ else
+ {
+ if (TAO_debug_level > 3)
+ ACE_ERROR ((LM_ERROR,
+ "TAO (%P|%t) - UIPMC_Connector::make_connection, "
+ "connection to <%C:%u> from interface <%s> failed (%p)\n",
+ uipmc_endpoint->host (),
+ uipmc_endpoint->port (),
+ uipmc_endpoint->is_preferred_network () ? uipmc_endpoint->preferred_network () : "ANY",
+ ACE_TEXT ("errno")));
+ }
+ uipmc_endpoint = dynamic_cast<TAO_UIPMC_Endpoint *> (uipmc_endpoint->next());
+ }
// Failure to open a connection.
if (retval != 0)
@@ -151,7 +197,9 @@ TAO_UIPMC_Connector::make_connection (TAO::Profile_Transport_Resolver *,
{
ACE_ERROR ((LM_ERROR,
"TAO (%P|%t) - UIPMC_Connector::make_connection, "
- "could not make a new connection\n"));
+ "failed to open the connection to <%C:%u>\n",
+ remote_address.get_host_addr (),
+ remote_address.get_port_number ()));
}
return 0;
@@ -176,8 +224,8 @@ TAO_UIPMC_Connector::make_connection (TAO::Profile_Transport_Resolver *,
ACE_ERROR ((LM_ERROR,
"TAO (%P|%t) - UIPMC_Connector::make_connection, "
"connection to <%C:%u> failed (%p)\n",
- uipmc_endpoint->host (),
- uipmc_endpoint->port (),
+ remote_address.get_host_addr (),
+ remote_address.get_port_number (),
ACE_TEXT ("errno")));
return 0;
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp
index 54974a7fc9a..da6e5ea716c 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.cpp
@@ -6,6 +6,7 @@
#include "tao/debug.h"
#include "ace/Guard_T.h"
#include "tao/ORB_Constants.h"
+#include "tao/ORB_Core.h"
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_Memory.h"
@@ -21,7 +22,9 @@ TAO_UIPMC_Endpoint::TAO_UIPMC_Endpoint (void)
host_ (),
port_ (0),
object_addr_ (),
- next_ (0)
+ preferred_path_ (),
+ next_ (0),
+ preferred_if_()
{
}
@@ -30,7 +33,9 @@ TAO_UIPMC_Endpoint::TAO_UIPMC_Endpoint (const ACE_INET_Addr &addr)
host_ (),
port_ (0),
object_addr_ (addr),
- next_ (0)
+ preferred_path_ (),
+ next_ (0),
+ preferred_if_()
{
this->object_addr (addr);
}
@@ -40,7 +45,9 @@ TAO_UIPMC_Endpoint::TAO_UIPMC_Endpoint (const CORBA::Octet class_d_address[4],
CORBA::UShort port)
: TAO_Endpoint (IOP::TAG_UIPMC),
port_ (port),
- next_ (0)
+ preferred_path_ (),
+ next_ (0),
+ preferred_if_()
{
for (int i = 0; i<4; i++)
this->class_d_address_[i] = class_d_address[i];
@@ -151,4 +158,84 @@ TAO_UIPMC_Endpoint::hash (void)
return this->hash_val_;
}
+CORBA::ULong
+TAO_UIPMC_Endpoint::preferred_interfaces (TAO_ORB_Core *oc)
+{
+ ACE_Vector<ACE_CString> preferred;
+ TAO_IIOP_Endpoint::find_preferred_interfaces(this->host_.in(),
+ oc->orb_params ()->preferred_interfaces (),
+ preferred);
+
+ TAO_UIPMC_Endpoint *latest = this;
+ CORBA::ULong count = preferred.size();
+ CORBA::ULong i = 0;
+
+ while (i < count)
+ {
+#if defined (ACE_HAS_IPV6)
+ if (ACE_OS::strstr (preferred[i].c_str(), "if=") != 0
+ && this->object_addr_.get_type () == AF_INET6)
+ {
+ latest->preferred_if_ = CORBA::string_dup (preferred[i].c_str() + 3);
+ latest->preferred_path_.host = (const char *) 0;
+ if (TAO_debug_level > 3)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - TAO_UIPMC_Endpoint::preferred_interfaces, setting network interface name <%s>"
+ " as preferred path for [%s] \n",
+ latest->preferred_if_.in(), this->host_.in ()));
+ }
+ else
+#endif /* ACE_HAS_IPV6 */
+ {
+ latest->preferred_path_.host =
+ CORBA::string_dup (preferred[i].c_str());
+
+ if (TAO_debug_level > 3)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - TAO_UIPMC_Endpoint::preferred_interfaces, adding path [%s]"
+ " as preferred local address for [%s] \n",
+ latest->preferred_path_.host.in(), this->host_.in ()));
+ }
+
+ ++i;
+ if (i < count)
+ {
+ TAO_Endpoint *tmp_ep =
+ latest->duplicate ();
+ latest->next_ = dynamic_cast<TAO_UIPMC_Endpoint *> (tmp_ep);
+ if (latest->next_ == 0) return i;
+ latest = latest->next_;
+ }
+ }
+
+ if (count > 0 &&
+ !oc->orb_params ()->enforce_pref_interfaces ())
+ {
+ TAO_Endpoint *tmp_ep = latest->duplicate ();
+
+ latest->next_ =
+ dynamic_cast<TAO_UIPMC_Endpoint *> (tmp_ep);
+
+ if (latest->next_ == 0) return count;
+
+ latest->next_->preferred_path_.host = (const char *) 0;
+ ++count;
+ }
+
+ return count;
+}
+
+bool
+TAO_UIPMC_Endpoint::is_preferred_network (void) const
+{
+ return (this->preferred_path_.host.in () != 0 &&
+ this->preferred_path_.host.in ()[0] != 0);
+}
+
+const char *
+TAO_UIPMC_Endpoint::preferred_network (void) const
+{
+ return this->preferred_path_.host.in ();
+}
+
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h
index a6af07379a6..b0f2606be5b 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.h
@@ -18,6 +18,7 @@
#include /**/ "ace/pre.h"
#include "tao/Endpoint.h"
+#include "tao/IIOP_Endpoint.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -93,6 +94,19 @@ public:
//TAO_UIPMC_Connection_Handler *&hint (void);
// Access to our <hint_>.
+ /// Do we have a preferred local network interface set for this target?
+ bool is_preferred_network (void) const;
+
+ /// Return the preferred network interface if any.
+ const char *preferred_network (void) const;
+
+ /// Transform this endpoint into (potentially) a chain of endpoints
+ /// in preferrence order of specific local interface bind address (if
+ /// the ORB is thus configured)
+ CORBA::ULong preferred_interfaces (TAO_ORB_Core *oc);
+
+ /// Acessor for the preferred network interface name if set
+ const char *preferred_if (void) const;
private:
@@ -116,9 +130,15 @@ private:
/// invocations, etc.
ACE_INET_Addr object_addr_;
- /// UIPMC Endpoints can be stringed into a list. Return the next
+ /// Preferred path for routing this endpoint.
+ TAO::IIOP_Endpoint_Info preferred_path_;
+
+ /// UIPMC Endpoints can be strung into a list. Return the next
/// endpoint in the list, if any.
TAO_UIPMC_Endpoint *next_;
+
+ /// Preferred interface name (if set)
+ CORBA::String_var preferred_if_;
};
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.inl b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.inl
index 7d91cc4d459..b33e05ec5ea 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.inl
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Endpoint.inl
@@ -49,4 +49,11 @@ TAO_UIPMC_Endpoint::update_object_addr (void)
this->uint_ip_addr ());
}
+
+ACE_INLINE const char*
+TAO_UIPMC_Endpoint::preferred_if () const
+{
+ return this->preferred_if_.in();
+}
+
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp
index b7791358d93..de8fc0c8430 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.cpp
@@ -13,7 +13,8 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_UIPMC_Protocol_Factory::TAO_UIPMC_Protocol_Factory (void)
: TAO_Protocol_Factory (IOP::TAG_UIPMC),
major_ (TAO_DEF_GIOP_MAJOR),
- minor_ (TAO_DEF_GIOP_MINOR)
+ minor_ (TAO_DEF_GIOP_MINOR),
+ listen_on_all_(false)
{
}
@@ -46,16 +47,38 @@ TAO_UIPMC_Protocol_Factory::make_acceptor (void)
TAO_Acceptor *acceptor = 0;
ACE_NEW_RETURN (acceptor,
- TAO_UIPMC_Acceptor,
+ TAO_UIPMC_Acceptor(this->listen_on_all_),
0);
return acceptor;
}
int
-TAO_UIPMC_Protocol_Factory::init (int /* argc */,
- ACE_TCHAR* /* argv */ [])
+TAO_UIPMC_Protocol_Factory::init (int argc,
+ ACE_TCHAR* argv [])
{
+ for (int curarg = 0; curarg < argc; ++curarg)
+ {
+ // This option lets you override the default
+ if (ACE_OS::strcasecmp (argv[curarg],
+ ACE_TEXT ("-ORBListenOnAll")) == 0)
+ {
+ ++curarg;
+ if (curarg < argc)
+ {
+ if (curarg < argc)
+ this->listen_on_all_ = (bool) ACE_OS::atoi (argv[curarg]);
+ }
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO_UIPMC_Protocol_Factory::init - ")
+ ACE_TEXT ("ignoring unknown option <%s>\n"),
+ argv[curarg]));
+ }
+ }
+
return 0;
}
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h
index b914111489e..3b08b2e64e2 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Factory.h
@@ -60,6 +60,9 @@ private:
/// compatibility with old clients.
int major_;
int minor_;
+ /// Should we override the default behaviour (whatever it is) to listen on
+ /// all interfaces
+ bool listen_on_all_;
};
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.cpp
index dc4dc4b0de4..b6f1861a59a 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.cpp
@@ -21,7 +21,8 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_UIPMC_Mcast_Connection_Handler::TAO_UIPMC_Mcast_Connection_Handler (
ACE_Thread_Manager *t)
: TAO_UIPMC_MCAST_SVC_HANDLER (t, 0 , 0),
- TAO_Connection_Handler (0)
+ TAO_Connection_Handler (0),
+ listen_on_all_(false)
{
// This constructor should *never* get called, it is just here to
// make the compiler happy: the default implementation of the
@@ -34,7 +35,8 @@ TAO_UIPMC_Mcast_Connection_Handler::TAO_UIPMC_Mcast_Connection_Handler (
TAO_UIPMC_Mcast_Connection_Handler::TAO_UIPMC_Mcast_Connection_Handler (
TAO_ORB_Core *orb_core)
: TAO_UIPMC_MCAST_SVC_HANDLER (orb_core->thr_mgr (), 0, 0),
- TAO_Connection_Handler (orb_core)
+ TAO_Connection_Handler (orb_core),
+ listen_on_all_(false)
{
UIPMC_MULTICAST_TRANSPORT* specific_transport = 0;
ACE_NEW(specific_transport,
@@ -102,17 +104,34 @@ TAO_UIPMC_Mcast_Connection_Handler::open_handler (void *v)
int
TAO_UIPMC_Mcast_Connection_Handler::open (void*)
{
- this->peer ().join (this->local_addr_);
+ if (this->listen_on_all_)
+ {
+ this->peer ().opts(ACE_SOCK_Dgram_Mcast::OPT_NULLIFACE_ALL | this->peer ().opts());
+ }
- if (TAO_debug_level > 5)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT("TAO (%P|%t) - UIPMC_Mcast_Connection_Handler::open_server, ")
- ACE_TEXT("subcribed to multicast group at %s:%d\n"),
- this->local_addr_.get_host_addr (),
- this->local_addr_.get_port_number ()
- ));
- }
+ if (this->peer ().join (this->local_addr_) == 0)
+ {
+ if (TAO_debug_level > 5)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO (%P|%t) - UIPMC_Mcast_Connection_Handler::open, ")
+ ACE_TEXT("subscribed to multicast group at <%s:%d>\n"),
+ this->local_addr_.get_host_addr (),
+ this->local_addr_.get_port_number ()
+ ));
+ }
+ }
+ else
+ {
+ ACE_DEBUG ((LM_ERROR,
+ ACE_TEXT("TAO (%P|%t) - UIPMC_Mcast_Connection_Handler::open, ")
+ ACE_TEXT("failed to subscribe to multicast group at <%s:%d>%p\n"),
+ this->local_addr_.get_host_addr (),
+ this->local_addr_.get_port_number (),
+ ACE_TEXT(". Errno")
+ ));
+ return -1;
+ }
this->transport ()->id ((size_t) this->peer ().get_handle ());
@@ -228,4 +247,10 @@ TAO_UIPMC_Mcast_Connection_Handler::handle_write_ready
return ACE::handle_write_ready (this->peer ().get_handle (), t);
}
+void
+TAO_UIPMC_Mcast_Connection_Handler::listen_on_all(bool value)
+{
+ this->listen_on_all_ = value;
+}
+
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.h
index f6593c8f660..c3d41a70e9b 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.h
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Mcast_Connection_Handler.h
@@ -108,6 +108,10 @@ public:
int n,
const ACE_Addr &addr,
int flags = 0) const;
+
+ /// Set this to listen on all interfaces
+ void listen_on_all(bool value);
+
// UIPMC Additions - End
protected:
@@ -120,6 +124,9 @@ protected:
// This is always the local address for the connector
ACE_INET_Addr local_addr_;
+ // Should we listen on all interfaces
+ bool listen_on_all_;
+
// UIPMC Additions - End
//@{
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp
index 0fd854dfe70..0bf6969b917 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Profile.cpp
@@ -162,6 +162,10 @@ TAO_UIPMC_Profile::decode_profile (TAO_InputCDR& cdr)
// and port with the new data.
ACE_INET_Addr addr (port, address.c_str ());
this->endpoint_.object_addr (addr);
+ if (this->orb_core ()->orb_params ()->preferred_interfaces ())
+ {
+ this->endpoint_.preferred_interfaces (this->orb_core ());
+ }
return 1;
}
@@ -351,12 +355,20 @@ TAO_UIPMC_Profile::parse_string_i (const char *string)
// Parse the group multicast address.
// The multicast address is terminated by a ':'.
string = pos + 1;
- pos = ACE_OS::strchr (string, ':');
+ pos = ACE_OS::strrchr (string, ':');
if (pos == 0)
{
// The multicast address is mandatory, so throw an exception,
// since it wasn't found.
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - UIPMC_Profile: ")
+ ACE_TEXT ("Invalid ref: can't find multicast address in %s\n"),
+ string
+ ));
+ }
throw CORBA::INV_OBJREF (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
@@ -470,6 +482,11 @@ TAO_UIPMC_Profile::parse_string_i (const char *string)
this->set_group_info (group_domain_id.c_str (),
group_id,
ref_version);
+
+ if (this->orb_core ()->orb_params ()->preferred_interfaces ())
+ {
+ this->endpoint_.preferred_interfaces (this->orb_core ());
+ }
}
CORBA::Boolean
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp
index 426e7c4c3aa..e6b58a05a60 100644
--- a/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/UIPMC_Transport.cpp
@@ -283,8 +283,10 @@ TAO_UIPMC_Transport<CONNECTION_HANDLER>::send (iovec *iov, int iovcnt,
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("\n\nTAO (%P|%t) - ")
- ACE_TEXT ("UIPMC_Transport::send")
+ ACE_TEXT ("UIPMC_Transport::send to %C (port %u)")
ACE_TEXT (" %p\n\n"),
+ addr.get_host_addr (),
+ addr.get_port_number (),
ACE_TEXT ("Error returned from transport:")));
}