[openrtm-commit:00264] r2208 - in trunk/OpenRTM-aist: etc src/lib/rtm
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 7月 24日 (日) 07:42:32 JST
Author: n-ando
Date: 2011-07-24 07:42:32 +0900 (Sun, 24 Jul 2011)
New Revision: 2208
Modified:
trunk/OpenRTM-aist/etc/rtc.conf.sample
trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp
Log:
New option "corba.alternate_iiop_addresses" has been added.
Modified: trunk/OpenRTM-aist/etc/rtc.conf.sample
===================================================================
--- trunk/OpenRTM-aist/etc/rtc.conf.sample 2011-07-22 03:31:02 UTC (rev 2207)
+++ trunk/OpenRTM-aist/etc/rtc.conf.sample 2011-07-23 22:42:32 UTC (rev 2208)
@@ -118,6 +118,35 @@
#
corba.nameservice.replace_endpoint: NO
+#
+# IOR alternate IIOP addresses
+#
+# This option adds alternate IIOP addresses into the IOR Profiles.
+# IOR can include additional endpoints for a servant. It is almost
+# same as "corba.endpoints" option, but this option does not create
+# actual endpoint on the ORB. (corba.endpoints try to create actual
+# endpoint, and if it cannot be created, error will be returned.)
+# This option just add alternate IIOP endpoint address information to
+# an IOR.
+#
+# This option can be used when RTCs are located inside of NAT or
+# router. Generally speaking, RTCs in a private network cannot
+# connect to RTCs in the global network, because global client cannot
+# reach to private servants. However, if route (or NAT) is properly
+# configured for port forwarding, global RTCs can reach to RTCs in
+# private network.
+#
+# A setting example is as follows.
+# 1) Configure your router properly for port-forwarding.
+# ex. global 2810 port is forwarded to private 2810
+# 2) Set the following options in rtc.conf
+# corba.nameservers: my.global.nameserver.com <- name server in global network
+# corba.endpoints: :2810 <- actual port number
+# corba.additional_ior_addresses: w.x.y.z:2810 <- routers global IP addr/port
+# 3) Launch global RTCs and private RTC, and connect them.
+#
+corba.alternate_iiop_addresses: addr:port
+
#============================================================
# Naming configurations
#============================================================
Modified: trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp
===================================================================
--- trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp 2011-07-22 03:31:02 UTC (rev 2207)
+++ trunk/OpenRTM-aist/src/lib/rtm/Manager.cpp 2011-07-23 22:42:32 UTC (rev 2208)
@@ -1095,6 +1095,29 @@
}
// Get the POAManager
m_pPOAManager = m_pPOA->the_POAManager();
+
+#ifdef ORB_IS_OMNIORB
+ const char* conf = "corba.alternate_iiop_addresses";
+ if (m_config.findNode(conf) != NULL)
+ {
+ coil::vstring addr_list;
+ addr_list = coil::split(m_config[conf], ",", true);
+
+ for (size_t i(0); i < addr_list.size(); ++i)
+ {
+ coil::vstring addr_port = coil::split(addr_list[i], ":");
+ if (addr_port.size() == 2)
+ {
+ IIOP::Address iiop_addr;
+ iiop_addr.host = addr_port[0].c_str();
+ CORBA::UShort port;
+ coil::stringTo(port, addr_port[1].c_str());
+ iiop_addr.port = port;
+ omniIOR::add_IIOP_ADDRESS(iiop_addr);
+ }
+ }
+ }
+#endif // ORB_IS_OMNIORB
}
catch (...)
{
openrtm-commit メーリングリストの案内