diff options
author | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-09 16:28:18 +0000 |
---|---|---|
committer | naga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-09-09 16:28:18 +0000 |
commit | 85cf8592e44f65733675bc1d58dbe3b8434554f3 (patch) | |
tree | aadc066bf7699b98a2c54ac848fed88119d245a5 /TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | |
parent | 80e38410f9c311ca8dbdba8279adf85962bc18e9 (diff) | |
download | ATCD-85cf8592e44f65733675bc1d58dbe3b8434554f3.tar.gz |
Diffstat (limited to 'TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp')
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 138 |
1 files changed, 71 insertions, 67 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index b6c7ec80eeb..2f711935136 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -628,87 +628,91 @@ Client::get_cubit_from_naming (void) } int -Client::get_cubit (void) + Client::get_cubit (void) { int result; CORBA::Object_var objref (0); TAO_TRY { - if (this->ts_->use_name_service_ != 0) - result = this->get_cubit_from_naming (); - else - { - if (this->naming_success_ == 0) + if (this->ts_->use_name_service_ != 0) { - char *my_ior = - this->ts_->use_utilization_test_ == 1 - ? this->ts_->one_ior_ - : this->ts_->iors_[this->id_]; - - // If we are running the "1 to n" test make sure all low - // priority clients use only 1 low priority servant. - if (this->id_ > 0 - && this->ts_->one_to_n_test_ == 1) - my_ior = this->ts_->iors_[1]; - - if (my_ior == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Must specify valid factory ior key with -k option," - " naming service, or ior filename\n"), - -1); - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) The ior I'm using is: \"%s\"\n", - my_ior)); - - // If we are running the "1 to n" test make sure all low - // priority clients use only 1 low priority servant. - if (this->id_ > 0 - && this->ts_->one_to_n_test_ == 1) - my_ior = this->ts_->iors_[1]; - - if (my_ior == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Must specify valid factory ior key with -k option," - " naming service, or ior filename\n"), - -1); - objref = this->orb_->string_to_object (my_ior, - TAO_TRY_ENV); - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) String_to_object success\n")); - TAO_CHECK_ENV; - } + result = this->get_cubit_from_naming (); + if (result < 0) + return result; + } + else + { + if (this->naming_success_ == 0) + { + char *my_ior = + this->ts_->use_utilization_test_ == 1 + ? this->ts_->one_ior_ + : this->ts_->iors_[this->id_]; + + // If we are running the "1 to n" test make sure all low + // priority clients use only 1 low priority servant. + if (this->id_ > 0 + && this->ts_->one_to_n_test_ == 1) + my_ior = this->ts_->iors_[1]; + + if (my_ior == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Must specify valid factory ior key with -k option," + " naming service, or ior filename\n"), + -1); + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) The ior I'm using is: \"%s\"\n", + my_ior)); + + // If we are running the "1 to n" test make sure all low + // priority clients use only 1 low priority servant. + if (this->id_ > 0 + && this->ts_->one_to_n_test_ == 1) + my_ior = this->ts_->iors_[1]; + + if (my_ior == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Must specify valid factory ior key with -k option," + " naming service, or ior filename\n"), + -1); + objref = this->orb_->string_to_object (my_ior, + TAO_TRY_ENV); + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) String_to_object success\n")); + TAO_CHECK_ENV; + } - if (CORBA::is_nil (objref.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%t) string_to_object or NameService->resolve() Failed!\n"), - -1); + if (CORBA::is_nil (objref.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%t) string_to_object or NameService->resolve() Failed!\n"), + -1); - // Narrow the CORBA::Object reference to the stub object, - // checking the type along the way using _is_a. - this->cubit_ = Cubit::_narrow (objref.in (), - TAO_TRY_ENV); - TAO_CHECK_ENV; + // Narrow the CORBA::Object reference to the stub object, + // checking the type along the way using _is_a. + this->cubit_ = Cubit::_narrow (objref.in (), + TAO_TRY_ENV); + TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG, - "(%t) _narrow done\n")); + ACE_DEBUG ((LM_DEBUG, + "(%t) _narrow done\n")); - if (CORBA::is_nil (this->cubit_)) - ACE_ERROR_RETURN ((LM_ERROR, - "Create cubit failed\n"), - 1); + if (CORBA::is_nil (this->cubit_)) + ACE_ERROR_RETURN ((LM_ERROR, + "Create cubit failed\n"), + 1); - ACE_DEBUG ((LM_DEBUG, - "(%t) Binding succeeded\n")); + ACE_DEBUG ((LM_DEBUG, + "(%t) Binding succeeded\n")); - CORBA::String_var str = - this->orb_->object_to_string (this->cubit_, TAO_TRY_ENV); - TAO_CHECK_ENV; + CORBA::String_var str = + this->orb_->object_to_string (this->cubit_, TAO_TRY_ENV); + TAO_CHECK_ENV; - ACE_DEBUG ((LM_DEBUG, - "(%t) CUBIT OBJECT connected <%s>\n", - str.in ())); - } + ACE_DEBUG ((LM_DEBUG, + "(%t) CUBIT OBJECT connected <%s>\n", + str.in ())); + } } TAO_CATCHANY { |