summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-11-03 03:37:54 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-11-03 03:37:54 +0000
commit0a387376acd34fb6c0bfcd0865bc7abe6008863b (patch)
tree5efcb7a977d5a26b03fe8c65f945c665c489a624 /TAO/tao
parentae098feac9d8ac72d48414b592403f8d899667e5 (diff)
downloadATCD-0a387376acd34fb6c0bfcd0865bc7abe6008863b.tar.gz
ChangeLogTag:Tue Nov 2 21:19:42 1999 Darrell Brunsch <brunsch@cs.wustl.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/ORB.cpp76
-rw-r--r--TAO/tao/ORB.h3
-rw-r--r--TAO/tao/ORB_Core.cpp13
-rw-r--r--TAO/tao/params.cpp3
-rw-r--r--TAO/tao/params.h8
-rw-r--r--TAO/tao/params.i11
6 files changed, 76 insertions, 38 deletions
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp
index a2b61b9bdf8..2cb55e07052 100644
--- a/TAO/tao/ORB.cpp
+++ b/TAO/tao/ORB.cpp
@@ -467,64 +467,68 @@ CORBA_ORB::resolve_service (MCAST_SERVICEID mcast_service_id,
"ImplRepoServicePort"
};
- u_short default_service_port [] =
- {
- TAO_DEFAULT_NAME_SERVER_REQUEST_PORT,
- TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT,
- TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT
- };
-
- const char * service_objid [] =
- {
- TAO_OBJID_NAMESERVICE,
- TAO_OBJID_TRADINGSERVICE,
- TAO_OBJID_IMPLREPOSERVICE
- };
-
- CORBA_Object_var return_value = CORBA_Object::_nil ();
-
- // By now, the table filled in with -ORBInitRef arguments has been
- // checked. We only get here if the table didn't contain an initial
- // reference for the requested Service.
-
- // Check to see if the user has an environment variable.
- ACE_CString service_ior = ACE_OS::getenv (env_service_ior[mcast_service_id]);
+ u_short default_service_port [] =
+ {
+ TAO_DEFAULT_NAME_SERVER_REQUEST_PORT,
+ TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT,
+ TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT
+ };
- if (service_ior.length () != 0)
+ const char * service_objid [] =
+ {
+ TAO_OBJID_NAMESERVICE,
+ TAO_OBJID_TRADINGSERVICE,
+ TAO_OBJID_IMPLREPOSERVICE
+ };
+
+ CORBA_Object_var return_value = CORBA_Object::_nil ();
+
+ // By now, the table filled in with -ORBInitRef arguments has been
+ // checked. We only get here if the table didn't contain an initial
+ // reference for the requested Service.
+
+ // Check to see if the user has an environment variable.
+ ACE_CString service_ior = ACE_OS::getenv (env_service_ior[mcast_service_id]);
+
+ if (service_ior.length () != 0)
{
return_value =
this->string_to_object (service_ior.c_str (),
ACE_TRY_ENV);
ACE_CHECK_RETURN (CORBA_Object::_nil ());
}
- else
+ else
{
// First, determine if the port was supplied on the command line
u_short port =
this->orb_core_->orb_params ()->service_port (mcast_service_id);
-
+
if (port == 0)
{
// Look for the port among our environment variables.
const char *port_number =
ACE_OS::getenv (env_service_port[mcast_service_id]);
-
+
if (port_number != 0)
port = (u_short) ACE_OS::atoi (port_number);
else
port = default_service_port[mcast_service_id];
}
-
- return_value =
- this->multicast_to_service (service_objid[mcast_service_id],
- port,
- timeout,
- ACE_TRY_ENV);
- ACE_CHECK_RETURN (CORBA_Object::_nil ());
+
+ // Find service with multicast.
+ if (this->orb_core_->orb_params ()->use_multicast ())
+ {
+ return_value =
+ this->multicast_to_service (service_objid[mcast_service_id],
+ port,
+ timeout,
+ ACE_TRY_ENV);
+ ACE_CHECK_RETURN (CORBA_Object::_nil ());
+ }
}
-
- // Return ior.
- return return_value._retn ();
+
+ // Return ior.
+ return return_value._retn ();
}
int
diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h
index db4b303a52a..0bf9defcc49 100644
--- a/TAO/tao/ORB.h
+++ b/TAO/tao/ORB.h
@@ -45,7 +45,8 @@
typedef enum
{
TAO_SERVICEID_NAMESERVICE,
- TAO_SERVICEID_TRADINGSERVICE
+ TAO_SERVICEID_TRADINGSERVICE,
+ TAO_SERVICEID_IMPLREPOSERVICE
} TAO_Service_ID;
// = Forward declarations.
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index f8b5dae89ef..061c0ca6964 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -256,6 +256,9 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
// Use TCP_NODELAY.
size_t nodelay = 1;
+ // Use Multicast
+ size_t multicast = 1;
+
// Should we skip the <ACE_Service_Config::open> method, e.g., if we
// already being configured by the ACE Service Configurator.
int skip_service_config_open = 0;
@@ -883,6 +886,15 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM);
}
+ else if ((current_arg = arg_shifter.get_the_parameter
+ ("-ORBMulticast")))
+ {
+ // Use Multicast or not.
+ multicast =
+ ACE_OS::atoi (current_arg);
+
+ arg_shifter.consume_arg ();
+ }
////////////////////////////////////////////////////////////////
// catch all the remaining -ORB args //
@@ -1084,6 +1096,7 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV)
this->orb_params ()->use_lite_protocol (giop_lite);
this->orb_params ()->std_profile_components (std_profile_components);
+ this->orb_params ()->use_multicast (multicast);
// Set up the pluggable protocol infrastructure. First get a
// pointer to the protocol factories set, then obtain pointers to
diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp
index 26cf6d0d3fa..359fa6f70f1 100644
--- a/TAO/tao/params.cpp
+++ b/TAO/tao/params.cpp
@@ -22,7 +22,8 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void)
cdr_memcpy_tradeoff_ (ACE_DEFAULT_CDR_MEMCPY_TRADEOFF),
use_lite_protocol_ (0),
use_dotted_decimal_addresses_ (0),
- std_profile_components_ (1)
+ std_profile_components_ (1),
+ use_multicast_ (1)
{
for (int i=0; i<= NO_OF_MCAST_SERVICES; i++)
this->service_port_[i] = 0;
diff --git a/TAO/tao/params.h b/TAO/tao/params.h
index 02b67e32e83..e47b42e6dd9 100644
--- a/TAO/tao/params.h
+++ b/TAO/tao/params.h
@@ -175,6 +175,11 @@ public:
// Disable the OMG standard profile components, useful for
// homogenous environments.
+ int use_multicast (void) const;
+ void use_multicast (int um);
+ // Set/Get the flag for whether multicast should be used in
+ // resolve_initial_references ().
+
private:
// Each "endpoint" is of the form:
//
@@ -248,6 +253,9 @@ private:
int std_profile_components_;
// If true then the standard OMG components are not generated.
+
+ int use_multicast_;
+ // 1 if we want to use multicast, 0 if we want to suppress it.
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/params.i b/TAO/tao/params.i
index 795cb20b4bd..5e592bce09f 100644
--- a/TAO/tao/params.i
+++ b/TAO/tao/params.i
@@ -171,3 +171,14 @@ TAO_ORB_Parameters::nodelay (int x)
this->nodelay_ = x;
}
+ACE_INLINE int
+TAO_ORB_Parameters::use_multicast (void) const
+{
+ return this->use_multicast_;
+}
+
+ACE_INLINE void
+TAO_ORB_Parameters::use_multicast (int um)
+{
+ this->use_multicast_ = um;
+}