diff options
author | vishal <vishal@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-10-17 00:47:39 +0000 |
---|---|---|
committer | vishal <vishal@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-10-17 00:47:39 +0000 |
commit | f6443c276889018efcffb2262fe35b86633e27e6 (patch) | |
tree | 0fc14e1c5ed996334477b512b290d7b534b88a11 | |
parent | 72ea8c5ea1b1ccd98da39c106a52dde2d92fc37d (diff) | |
download | ATCD-f6443c276889018efcffb2262fe35b86633e27e6.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp | 29 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/IOR_Multicast.h | 10 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 20 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 13 | ||||
-rw-r--r-- | TAO/tao/params.h | 9 | ||||
-rw-r--r-- | TAO/tao/params.i | 12 |
6 files changed, 89 insertions, 4 deletions
diff --git a/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp b/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp index c7daca5cffd..f25fbf9a781 100644 --- a/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp +++ b/TAO/orbsvcs/orbsvcs/IOR_Multicast.cpp @@ -45,15 +45,38 @@ TAO_IOR_Multicast::init (const char *ior, const char *mcast_addr, TAO_Service_ID service_id) { - this->service_id_ = service_id; - this->ior_ = ior; if (this->mcast_addr_.set (port, mcast_addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "set"), -1); - else if (this->response_addr_.set ((u_short) 0) == -1) + + return common_init (ior, service_id); +} + +int +TAO_IOR_Multicast::init (const char *ior, + const char *mcast_addr, + TAO_Service_ID service_id) +{ + if (this->mcast_addr_.set (mcast_addr) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "set"), + -1); + + return common_init (ior, service_id); +} + +int +TAO_IOR_Multicast::common_init (const char *ior, + TAO_Service_ID service_id) +{ + this->service_id_ = service_id; + this->ior_ = ior; + + if (this->response_addr_.set ((u_short) 0) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "set"), diff --git a/TAO/orbsvcs/orbsvcs/IOR_Multicast.h b/TAO/orbsvcs/orbsvcs/IOR_Multicast.h index aabf42e0b73..f35c7b71b2f 100644 --- a/TAO/orbsvcs/orbsvcs/IOR_Multicast.h +++ b/TAO/orbsvcs/orbsvcs/IOR_Multicast.h @@ -60,6 +60,12 @@ public: TAO_Service_ID service_id); // Initialization method. + int init (const char *ior, + const char *mcast_addr, + TAO_Service_ID service_id); + // Initialization method. Takes in "address:port" string as a + // parameter. + ~TAO_IOR_Multicast (void); // Destructor. @@ -74,6 +80,10 @@ public: // Returns the internal handle used to receive multicast. private: + int common_init (const char *ior, + TAO_Service_ID service_id); + // Factor common functionality from the two init functions. + char buf_[BUFSIZ]; // temporary buffer. diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index b3565541b9e..73f5919e284 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -604,7 +604,7 @@ CORBA_ORB::multicast_query (char *&buf, ACE_SOCK_Dgram dgram; ssize_t result = 0; - + // Bind listener to any port and then find out what the port was. if (acceptor.open (ACE_Addr::sap_any) == -1 || acceptor.get_local_addr (my_addr) == -1) @@ -618,6 +618,24 @@ CORBA_ORB::multicast_query (char *&buf, { ACE_INET_Addr multicast_addr (port, ACE_DEFAULT_MULTICAST_ADDR); + // Set the address if multicast_discovery_endpoint option + // is specified for the Naming Service. + ACE_CString mde (this->orb_core_->orb_params () + ->mcast_discovery_endpoint ()); + + if (ACE_OS::strcasecmp (service_name, + "NameService") == 0 + && mde.length () != 0) + if (multicast_addr.set (mde.c_str()) == -1) + { + ACE_ERROR ((LM_ERROR, + "ORB.cpp: Multicast address setting failed\n")); + stream.close (); + dgram.close (); + acceptor.close (); + return -1; + } + // Open the datagram. if (dgram.open (ACE_Addr::sap_any) == -1) { diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 228d48b9018..ddfa854f49e 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -243,6 +243,9 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) // Implementation Repository Service port #. u_short ir_port = 0; + // Mcast endpoint for the Naming Service discovery. + ACE_CString mde; + // Buffer sizes for kernel socket buffers // @@ should be a default defined for each protocol implementation? // since we may have protocols loaded which use shared memory of @@ -469,6 +472,15 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) arg_shifter.consume_arg (); } else if ((current_arg = arg_shifter.get_the_parameter + ("-ORBMulticastDiscoveryEndpoint"))) + { + // Specify mcast address:port for the Naming Service Multicast + // Discovery Protocol. + + mde = current_arg; + arg_shifter.consume_arg (); + } + else if ((current_arg = arg_shifter.get_the_parameter ("-ORBNodelay"))) { // Use TCP_NODELAY or not. @@ -1006,6 +1018,7 @@ TAO_ORB_Core::init (int &argc, char *argv[], CORBA::Environment &ACE_TRY_ENV) this->orb_params ()->name_service_port (ns_port); this->orb_params ()->trading_service_port (ts_port); this->orb_params ()->implrepo_service_port (ir_port); + this->orb_params ()->mcast_discovery_endpoint (mde); this->orb_params ()->use_dotted_decimal_addresses (dotted_decimal_addresses); this->orb_params ()->nodelay (nodelay); if (rcv_sock_size != 0) diff --git a/TAO/tao/params.h b/TAO/tao/params.h index 59ed0a6eeeb..f078a889497 100644 --- a/TAO/tao/params.h +++ b/TAO/tao/params.h @@ -124,6 +124,11 @@ public: void name_service_port (CORBA::UShort port); // Set/Get the port of our name service. + const char *mcast_discovery_endpoint (void) const; + void mcast_discovery_endpoint (const ACE_CString &mde); + // Set/Get address:port for Multicast Discovery Protocol for + // the Naming Service. + CORBA::UShort trading_service_port (void) const; void trading_service_port (CORBA::UShort port); // Set/Get the port of our trading service. @@ -221,6 +226,10 @@ private: CORBA::UShort implrepo_service_port_; // The port number of our configured Implementation Repository. + ACE_CString mcast_discovery_endpoint_; + // address:port for Multicast Discovery Protocol for the Naming + // Service. + ACE_CString init_ref_; // Initial Reference supplied as <ObjectID>:<IOR> diff --git a/TAO/tao/params.i b/TAO/tao/params.i index 1cf847c3813..56e483915b5 100644 --- a/TAO/tao/params.i +++ b/TAO/tao/params.i @@ -139,6 +139,18 @@ TAO_ORB_Parameters::implrepo_service_port (void) const return this->implrepo_service_port_; } +ACE_INLINE void +TAO_ORB_Parameters::mcast_discovery_endpoint (const ACE_CString &mde) +{ + this->mcast_discovery_endpoint_ = mde; +} + +ACE_INLINE const char * +TAO_ORB_Parameters::mcast_discovery_endpoint (void) const +{ + return this->mcast_discovery_endpoint_.c_str (); +} + ACE_INLINE TAO_IOR_LookupTable * TAO_ORB_Parameters::ior_lookup_table (void) { |