diff options
Diffstat (limited to 'TAO/examples/Simple/chat/Client_i.cpp')
-rw-r--r-- | TAO/examples/Simple/chat/Client_i.cpp | 56 |
1 files changed, 18 insertions, 38 deletions
diff --git a/TAO/examples/Simple/chat/Client_i.cpp b/TAO/examples/Simple/chat/Client_i.cpp index 268da16eaeb..d84fe2d98c0 100644 --- a/TAO/examples/Simple/chat/Client_i.cpp +++ b/TAO/examples/Simple/chat/Client_i.cpp @@ -84,14 +84,12 @@ Client_i::init (int argc, char *argv[]) if (this->parse_args (argc, argv) == -1) return -1; - ACE_TRY_NEW_ENV + try { // Retrieve the ORB. this->orb_manager_.init (argc, argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + 0); CORBA::ORB_var orb = this->orb_manager_.orb (); @@ -106,9 +104,7 @@ Client_i::init (int argc, char *argv[]) -1); CORBA::Object_var server_object = - orb->string_to_object (this->ior_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + orb->string_to_object (this->ior_); if (CORBA::is_nil (server_object.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -116,17 +112,13 @@ Client_i::init (int argc, char *argv[]) this->ior_), -1); - this->server_ = Broadcaster::_narrow (server_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->server_ = Broadcaster::_narrow (server_object.in ()); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "client_i::init\n"); + ex._tao_print_exception ("client_i::init\n"); return -1; } - ACE_ENDTRY; // Register our <Input_Handler> to handle STDIN events, which will // trigger the <handle_input> method to process these events. @@ -149,34 +141,27 @@ Client_i::run (void) "\n============= Simple Chat =================\n" "========== type 'quit' to exit ===========\n")); - ACE_TRY_NEW_ENV + try { PortableServer::POAManager_var poa_manager = this->orb_manager_.poa_manager (); - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + poa_manager->activate (); this->receiver_var_ = - this->receiver_i_._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->receiver_i_._this (); // Register ourselves with the server. server_->add (this->receiver_var_.in (), - this->nickname_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->nickname_); // Run the ORB. - this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_manager_.run (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Client_i::run ()"); + ex._tao_print_exception ("Client_i::run ()"); return -1; } - ACE_ENDTRY; return 0; } @@ -189,7 +174,7 @@ Client_i::handle_input (ACE_HANDLE) if (ACE_OS::fgets (buf, BUFSIZ, stdin) == 0) return 0; - ACE_TRY_NEW_ENV + try { // Check if the user wants to quit. if (ACE_OS::strncmp (buf, @@ -198,26 +183,21 @@ Client_i::handle_input (ACE_HANDLE) { // Remove ourselves from the server. this->server_->remove (this->receiver_var_.in ()); - this->receiver_i_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); + this->receiver_i_.shutdown (); - ACE_TRY_CHECK; return 0; } // Call the server function <say> to pass the string typed by // the server. this->server_->say (this->receiver_var_.in (), - buf - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + buf); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Input_Handler::init"); + ex._tao_print_exception ("Input_Handler::init"); return -1; } - ACE_ENDTRY; return 0; } |