diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-09-18 00:06:07 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-09-18 00:06:07 +0000 |
commit | e12b5d4ffb96ffdce21884a491273fb82a65cab9 (patch) | |
tree | 10e8af6827368c6ceb5e733627c5faf5e361b748 /TAO/tao/IIOP_Acceptor.cpp | |
parent | b792311a6a68d2359ab17efcd36a899eff948baf (diff) | |
download | ATCD-e12b5d4ffb96ffdce21884a491273fb82a65cab9.tar.gz |
ChangeLogTag: Mon Sep 17 19:00:00 2001 Irfan Pyarali <irfan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/IIOP_Acceptor.cpp')
-rw-r--r-- | TAO/tao/IIOP_Acceptor.cpp | 106 |
1 files changed, 51 insertions, 55 deletions
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp index c854f691e4e..c73e9f97a76 100644 --- a/TAO/tao/IIOP_Acceptor.cpp +++ b/TAO/tao/IIOP_Acceptor.cpp @@ -1,8 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - - #include "tao/IIOP_Acceptor.h" #include "tao/IIOP_Profile.h" #include "tao/MProfile.h" @@ -21,7 +19,6 @@ ACE_RCSID(tao, IIOP_Acceptor, "$Id$") - #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Acceptor<TAO_IIOP_Connection_Handler, ACE_SOCK_ACCEPTOR>; @@ -85,9 +82,9 @@ TAO_IIOP_Acceptor::~TAO_IIOP_Acceptor (void) // TODO = // 2) For V1.[1,2] there are tagged components int -TAO_IIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, - TAO_MProfile &mprofile, - CORBA::Boolean share_profile) +TAO_IIOP_Acceptor::create_profile (const TAO_ObjectKey &object_key, + TAO_MProfile &mprofile, + CORBA::Short priority) { // Sanity check. if (this->endpoint_count_ == 0) @@ -95,17 +92,20 @@ TAO_IIOP_Acceptor::create_mprofile (const TAO_ObjectKey &object_key, // Check if multiple endpoints should be put in one profile or // if they should be spread across multiple profiles. - if (share_profile == 1) - return this->create_shared_profile (object_key, - mprofile); + if (priority == TAO_INVALID_PRIORITY) + return this->create_new_profile (object_key, + mprofile, + priority); else - return this->create_new_profiles (object_key, - mprofile); + return this->create_shared_profile (object_key, + mprofile, + priority); } int -TAO_IIOP_Acceptor::create_new_profiles (const TAO_ObjectKey &object_key, - TAO_MProfile &mprofile) +TAO_IIOP_Acceptor::create_new_profile (const TAO_ObjectKey &object_key, + TAO_MProfile &mprofile, + CORBA::Short priority) { // Adding this->endpoint_count_ to the TAO_MProfile. int count = mprofile.profile_count (); @@ -125,6 +125,7 @@ TAO_IIOP_Acceptor::create_new_profiles (const TAO_ObjectKey &object_key, this->version_, this->orb_core_), -1); + pfile->endpoint ()->priority (priority); if (mprofile.give_profile (pfile) == -1) { @@ -155,7 +156,8 @@ TAO_IIOP_Acceptor::create_new_profiles (const TAO_ObjectKey &object_key, int TAO_IIOP_Acceptor::create_shared_profile (const TAO_ObjectKey &object_key, - TAO_MProfile &mprofile) + TAO_MProfile &mprofile, + CORBA::Short priority) { size_t index = 0; TAO_Profile *pfile = 0; @@ -166,11 +168,11 @@ TAO_IIOP_Acceptor::create_shared_profile (const TAO_ObjectKey &object_key, { pfile = mprofile.get_profile (i); if (pfile->tag () == TAO_TAG_IIOP_PROFILE) - { - iiop_profile = ACE_dynamic_cast (TAO_IIOP_Profile *, - pfile); - break; - } + { + iiop_profile = ACE_dynamic_cast (TAO_IIOP_Profile *, + pfile); + break; + } } // If <mprofile> doesn't contain a IIOP_Profile, we need to create @@ -185,7 +187,7 @@ TAO_IIOP_Acceptor::create_shared_profile (const TAO_ObjectKey &object_key, this->version_, this->orb_core_), -1); - iiop_profile->endpoint ()->priority (this->priority ()); + iiop_profile->endpoint ()->priority (priority); if (mprofile.give_profile (iiop_profile) == -1) { @@ -224,7 +226,7 @@ TAO_IIOP_Acceptor::create_shared_profile (const TAO_ObjectKey &object_key, this->addrs_[index].get_port_number (), this->addrs_[index]), -1); - endpoint->priority (this->priority_); + endpoint->priority (priority); iiop_profile->add_endpoint (endpoint); } @@ -259,6 +261,7 @@ TAO_IIOP_Acceptor::close (void) int TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core, + ACE_Reactor *reactor, int major, int minor, const char *address, @@ -318,7 +321,8 @@ TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core, 1) != 0) return -1; else - return this->open_i (addr); + return this->open_i (addr, + reactor); } else if (port_separator_loc == 0) { @@ -364,11 +368,13 @@ TAO_IIOP_Acceptor::open (TAO_ORB_Core *orb_core, if (this->addrs_[0].set (addr) != 0) return -1; - return this->open_i (addr); + return this->open_i (addr, + reactor); } int TAO_IIOP_Acceptor::open_default (TAO_ORB_Core *orb_core, + ACE_Reactor *reactor, int major, int minor, const char *options) @@ -413,11 +419,13 @@ TAO_IIOP_Acceptor::open_default (TAO_ORB_Core *orb_core, 1) != 0) return -1; - return this->open_i (addr); + return this->open_i (addr, + reactor); } int -TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr) +TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr, + ACE_Reactor *reactor) { ACE_NEW_RETURN (this->creation_strategy_, TAO_IIOP_CREATION_STRATEGY (this->orb_core_, @@ -438,7 +446,7 @@ TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr) { // don't care, i.e., let the OS choose an ephemeral port if (this->base_acceptor_.open (addr, - this->orb_core_->reactor (this), + reactor, this->creation_strategy_, this->accept_strategy_, this->concurrency_strategy_) == -1) @@ -468,7 +476,7 @@ TAO_IIOP_Acceptor::open_i (const ACE_INET_Addr& addr) // Now try to actually open on that port a.set_port_number (p); if (this->base_acceptor_.open (a, - this->orb_core_->reactor (this), + reactor, this->creation_strategy_, this->accept_strategy_, this->concurrency_strategy_) != -1) @@ -546,8 +554,7 @@ TAO_IIOP_Acceptor::hostname (TAO_ORB_Core *orb_core, // just return ours. return this->dotted_decimal_address (addr, host); } - else - if (specified_hostname != 0) + else if (specified_hostname != 0) { // If the user specified a hostname, pass it back // blindly as it overrides our choice of hostname. @@ -725,16 +732,16 @@ TAO_IIOP_Acceptor::object_key (IOP::TaggedProfile &profile, // processing. if (!(cdr.read_octet (major) && cdr.read_octet (minor))) - { - if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) IIOP_Profile::decode - v%d.%d\n"), - major, - minor)); - } - return -1; - } + { + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) IIOP_Profile::decode - v%d.%d\n"), + major, + minor)); + } + return -1; + } CORBA::String_var host; CORBA::UShort port = 0; @@ -838,22 +845,11 @@ TAO_IIOP_Acceptor::parse_options (const char *str) if (name == "priority") { - CORBA::Short corba_priority = - ACE_static_cast (CORBA::Short, - ACE_OS::atoi (value.c_str ())); - - if (corba_priority >= 0 - /* && corba_priority < 32768 */) - // priority_ and corba_priority will always be less - // than 32768 since CORBA::Short is a signed 16 bit - // integer. - this->priority_ = corba_priority; - else - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t) Invalid IIOP endpoint ") - ACE_TEXT ("priority: <%s>\n"), - value.c_str ()), - -1); + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("TAO (%P|%t) Invalid IIOP endpoint format: ") + ACE_TEXT ("endpoint priorities no longer supported. \n"), + value.c_str ()), + -1); } else if (name == "portspan") { |