summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-03 01:23:03 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-03 01:23:03 +0000
commit9c5e4f8d6ece2cb8bc4f91a50a94434dae5402e4 (patch)
tree5c08253192a02913c68bae84c6d7696b5dfb7697
parent36e939192579ebf9732e5cc4c7f8e19367d05364 (diff)
downloadATCD-9c5e4f8d6ece2cb8bc4f91a50a94434dae5402e4.tar.gz
Added the multicast port option to the ImplRepo suport.
-rw-r--r--TAO/tao/ORB.cpp24
-rw-r--r--TAO/tao/ORB_Core.cpp17
-rw-r--r--TAO/tao/orbconf.h17
-rw-r--r--TAO/tao/params.cpp1
-rw-r--r--TAO/tao/params.h7
-rw-r--r--TAO/tao/params.i12
6 files changed, 75 insertions, 3 deletions
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp
index b69511b7659..afa427ae9bd 100644
--- a/TAO/tao/ORB.cpp
+++ b/TAO/tao/ORB.cpp
@@ -680,6 +680,30 @@ CORBA_ORB::resolve_implrepo_service (ACE_Time_Value *timeout,
ACE_ENDTRY;
ACE_CHECK_RETURN (CORBA_Object::_duplicate (this->implrepo_service_));
}
+ else
+ {
+ // First, determine if the port was supplied on the command line
+ // @@ FRED: need a generic rep for this!
+ u_short port =
+ this->orb_core_->orb_params ()->implrepo_service_port ();
+
+ if (port == 0)
+ {
+ // Look for the port among our environment variables.
+ const char *port_number = ACE_OS::getenv ("ImplRepoServicePort");
+
+ if (port_number != 0)
+ port = ACE_OS::atoi (port_number);
+ else
+ port = TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT;
+ }
+
+ this->implrepo_service_ =
+ this->multicast_to_service ("ImplRepoService",
+ port,
+ timeout,
+ ACE_TRY_ENV);
+ }
}
return CORBA_Object::_duplicate (this->implrepo_service_);
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 5f4f2f1dd59..0bd7115e640 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -149,9 +149,12 @@ TAO_ORB_Core::init (int &argc, char *argv[])
// Trading Service port #.
u_short ts_port = 0;
- // Implementation Repository IOR string.
+ // Implementation Repository Service IOR string.
ACE_CString ir_ior;
+ // Implementation Repository Service port #.
+ u_short ir_port = 0;
+
// Buffer sizes for kernel socket buffers
size_t rcv_sock_size = 0;
size_t snd_sock_size = 0;
@@ -285,6 +288,17 @@ TAO_ORB_Core::init (int &argc, char *argv[])
arg_shifter.consume_arg ();
}
}
+ else if (ACE_OS::strcmp (current_arg, "-ORBimplrepoport") == 0)
+ {
+ // Specify the multicast port number for the Implementation Repository.
+
+ arg_shifter.consume_arg ();
+ if (arg_shifter.is_parameter_next ())
+ {
+ ir_port = ACE_OS::atoi (arg_shifter.get_current ());
+ arg_shifter.consume_arg ();
+ }
+ }
else if (ACE_OS::strcmp (current_arg, "-ORBport") == 0)
{
// Specify the port number/name on which we should listen
@@ -589,6 +603,7 @@ TAO_ORB_Core::init (int &argc, char *argv[])
this->orb_params ()->trading_service_ior (ts_ior);
this->orb_params ()->trading_service_port (ts_port);
this->orb_params ()->implrepo_service_ior (ir_ior);
+ this->orb_params ()->implrepo_service_port (ir_port);
this->orb_params ()->use_dotted_decimal_addresses (dotted_decimal_addresses);
if (rcv_sock_size != 0)
this->orb_params ()->sock_rcvbuf_size (rcv_sock_size);
diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h
index fc353549fce..23db6b9eb0c 100644
--- a/TAO/tao/orbconf.h
+++ b/TAO/tao/orbconf.h
@@ -118,13 +118,26 @@
// Service.
#if !defined (TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT)
#define TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT 10016
-#endif /* TAO_DEFAULT_NAME_SERVER_REQUEST_PORT */
+#endif /* TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT */
// The default UDP port number for replying to a location request to
// the TAO Trading Service.
#if !defined (TAO_DEFAULT_TRADING_SERVER_REPLY_PORT)
#define TAO_DEFAULT_TRADING_SERVER_REPLY_PORT 10017
-#endif /* TAO_DEFAULT_NAME_SERVER_REPLY_PORT */
+#endif /* TAO_DEFAULT_TRADING_SERVER_REPLY_PORT */
+
+// The default UDP multicast port number for locating the TAO
+// Implementation Repository Service.
+#if !defined (TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT)
+#define TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT 10018
+#endif /* TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT */
+
+// The default UDP port number for replying to a location request to
+// the TAO Implementation Repository Service.
+#if !defined (TAO_DEFAULT_IMPLREPO_SERVER_REPLY_PORT)
+#define TAO_DEFAULT_IMPLREPO_SERVER_REPLY_PORT 10019
+#endif /* TAO_DEFAULT_IMPLREPO_SERVER_REPLY_PORT */
+
// The default timeout receiving the location request to the TAO
// Naming, Trading and other servicesService.
diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp
index fafb7007d57..e373168d56d 100644
--- a/TAO/tao/params.cpp
+++ b/TAO/tao/params.cpp
@@ -13,6 +13,7 @@ ACE_RCSID(tao, params, "$Id$")
TAO_ORB_Parameters::TAO_ORB_Parameters (void)
: name_service_port_ (0),
trading_service_port_ (0),
+ implrepo_service_port_ (0),
ior_lookup_table_ (0),
sock_rcvbuf_size_ (ACE_DEFAULT_MAX_SOCKET_BUFSIZ),
sock_sndbuf_size_ (ACE_DEFAULT_MAX_SOCKET_BUFSIZ),
diff --git a/TAO/tao/params.h b/TAO/tao/params.h
index bc5c93adbe5..ce367b95bd8 100644
--- a/TAO/tao/params.h
+++ b/TAO/tao/params.h
@@ -86,6 +86,10 @@ public:
void implrepo_service_ior (const ACE_CString &ir);
// Set/Get the IOR of the Implementation Repository service.
+ CORBA::UShort implrepo_service_port (void) const;
+ void implrepo_service_port (CORBA::UShort port);
+ // Set/Get the port of the Implementation Repository service.
+
int sock_rcvbuf_size (void) const;
void sock_rcvbuf_size (int);
// Set/Get the size to be used for a socket's receive buffer.
@@ -158,6 +162,9 @@ private:
ACE_CString implrepo_service_ior_;
// The IOR of our configured Implementation Repository.
+ CORBA::UShort implrepo_service_port_;
+ // The port number of our configured Implementation Repository.
+
ACE_CString init_ref_;
// Initial Reference supplied as <ObjectID>:<IOR>
diff --git a/TAO/tao/params.i b/TAO/tao/params.i
index d50165033da..894e2678613 100644
--- a/TAO/tao/params.i
+++ b/TAO/tao/params.i
@@ -170,6 +170,18 @@ TAO_ORB_Parameters::implrepo_service_ior (void) const
return this->implrepo_service_ior_.c_str ();
}
+ACE_INLINE void
+TAO_ORB_Parameters::implrepo_service_port (CORBA::UShort port)
+{
+ this->implrepo_service_port_ = port;
+}
+
+ACE_INLINE CORBA::UShort
+TAO_ORB_Parameters::implrepo_service_port (void) const
+{
+ return this->implrepo_service_port_;
+}
+
ACE_INLINE TAO_IOR_LookupTable *
TAO_ORB_Parameters::ior_lookup_table (void)
{