summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-09-21 04:21:41 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-09-21 04:21:41 +0000
commitf8774380d9654b8375f475b73873d55e62622f95 (patch)
tree3adc4b103fd4eadc919129a6bf5f1e358177ce46
parentf73fe5ca6831341e8938279ceff090ca35cab30f (diff)
downloadATCD-f8774380d9654b8375f475b73873d55e62622f95.tar.gz
*** empty log message ***
-rw-r--r--TAO/examples/Simple/echo/Client_i.cpp28
-rw-r--r--TAO/examples/Simple/echo/README19
-rw-r--r--TAO/examples/Simple/echo/Server_i.cpp28
-rwxr-xr-xTAO/examples/Simple/echo/run_test.pl5
-rw-r--r--TAO/examples/Simple/echo/server.cpp1
5 files changed, 33 insertions, 48 deletions
diff --git a/TAO/examples/Simple/echo/Client_i.cpp b/TAO/examples/Simple/echo/Client_i.cpp
index de3538b6f8c..80a4731a24a 100644
--- a/TAO/examples/Simple/echo/Client_i.cpp
+++ b/TAO/examples/Simple/echo/Client_i.cpp
@@ -18,6 +18,7 @@ Client_i::Client_i (void)
}
// Reads the Server factory IOR from a file.
+
int
Client_i::read_ior (char *filename)
{
@@ -169,20 +170,20 @@ int
Client_i::via_naming_service(void)
{
TAO_TRY
- {
+ {
// Initialization of the naming service.
if (naming_services_client_.init (orb_.in (), argc_, argv_) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to initialize "
- "the TAO_Naming_Client. \n"),
- -1);
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Unable to initialize "
+ "the TAO_Naming_Client. \n"),
+ -1);
CosNaming::Name echo_ref_name (1);
echo_ref_name.length (1);
echo_ref_name[0].id = CORBA::string_dup ("Echo");
CORBA::Object_var echo_obj =
this->naming_services_client_->resolve (echo_ref_name,
- TAO_TRY_ENV);
+ TAO_TRY_ENV);
TAO_CHECK_ENV;
// The CORBA::Object_var object is downcast to Echo_var using
@@ -191,14 +192,13 @@ Client_i::via_naming_service(void)
Echo::_narrow (echo_obj.in (),
TAO_TRY_ENV);
TAO_CHECK_ENV;
-
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("Echo::via_naming_service\n");
- return -1;
- }
- TAO_ENDTRY;
+ }
+ TAO_CATCHANY
+ {
+ TAO_TRY_ENV.print_exception ("Echo::via_naming_service\n");
+ return -1;
+ }
+ TAO_ENDTRY;
return 0;
}
diff --git a/TAO/examples/Simple/echo/README b/TAO/examples/Simple/echo/README
index 7bee2144a85..b4cd5a8d92f 100644
--- a/TAO/examples/Simple/echo/README
+++ b/TAO/examples/Simple/echo/README
@@ -1,22 +1,22 @@
$Id$
This is a simple CORBA example that has an object (Echo) with only two
-methods, one that returns the message to be displayed and
-another that shuts down the server.
+methods, one that returns the message to be displayed and another that
+shuts down the server.
server:
-------
-server [-d] [-o <ior_output_file>]
+server [-d] [-o <ior_output_file>]
Options:
-------
-d Debug flag (It is additive more -d flags will give debugging).
-o Outputs the server ior to the file
-
-When the server is started, you should see as the first line of output
+When the server is started, you should see as the first line of output
something that looks like
+
iiop:1.0//danzon.cs.wustl.edu:10015/P35ad159600081a38/child_poa/server
(-ORBobjrefstyle url)
or
@@ -40,15 +40,14 @@ Options:
-f Reads the server ior from the file
-n no. of iterations
-k IOR
-
+
You can either cut and paste the IOR from the server to the client
(with the -k option), or have the client read the IOR from a file
using the -f option. (This file is produced using the -o option of the
server.)
-
+
run_test.pl:
------------
-This is a perl script which runs the server and client, and shuts down
-the server when it is done.
-
+This perl script runs the server and client and shuts down the server
+when it is done.
diff --git a/TAO/examples/Simple/echo/Server_i.cpp b/TAO/examples/Simple/echo/Server_i.cpp
index 2126ce6b659..132cf98b3da 100644
--- a/TAO/examples/Simple/echo/Server_i.cpp
+++ b/TAO/examples/Simple/echo/Server_i.cpp
@@ -34,7 +34,7 @@ Server_i::init_naming_service (CORBA::Environment& env)
PortableServer::POA_var child_poa
= this->orb_manager_.child_poa ();
- TAO_debug_level = 1; // ******
+ TAO_debug_level = 1;
int return_val =
this->naming_server_.init (orb.in (),
child_poa.in ());
@@ -59,7 +59,6 @@ Server_i::init_naming_service (CORBA::Environment& env)
echo_obj.in (),
env);
TAO_CHECK_ENV_RETURN (env, -1);
-
}
TAO_CATCHANY
{
@@ -78,17 +77,12 @@ Server_i::parse_args (void)
ACE_Get_Opt get_opts (this->argc_, this->argv_, "do: ");
int c;
- // @@ I think that by default, we should use the naming service.
- // Can you please check how things work for IDL_Cubit and follow the
- // same conventions?
-
while ((c = get_opts ()) != -1)
switch (c)
{
case 'd': // debug flag.
TAO_debug_level++; ///*****
break;
-
case 'o': // output the IOR toi a file.
this->ior_output_file_ = ACE_OS::fopen (get_opts.optarg, "w");
if (this->ior_output_file_ == 0)
@@ -97,11 +91,9 @@ Server_i::parse_args (void)
get_opts.optarg),
-1);
break;
-
case 's': // don't use the naming service
this->using_naming_service_ = 0;
break;
-
case '?': // display help for use of the server.
default:
ACE_ERROR_RETURN ((LM_ERROR,
@@ -122,20 +114,19 @@ Server_i::parse_args (void)
int
Server_i::init (int argc,
char *argv[],
- CORBA::Environment &env)
+ CORBA::Environment &TAO_TRY_ENV)
{
// Call the init of <TAO_ORB_Manager> to initialize the ORB and
// create the child poa under the root POA.
if (this->orb_manager_.init_child_poa (argc,
argv,
"child_poa",
- env) == -1)
+ TAO_TRY_ENV) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"init_child_poa"),
-1);
-
- TAO_CHECK_ENV_RETURN (env, -1);
+ TAO_CHECK_ENV_RETURN (TAO_TRY_ENV, -1);
this->argc_ = argc;
this->argv_ = argv;
@@ -150,16 +141,14 @@ Server_i::init (int argc,
// Stash our ORB pointer for later reference.
this->servant_.orb (orb.in ());
- // @@ Please change this, as well!
// Activate the servant in the POA.
CORBA::String_var str =
this->orb_manager_.activate_under_child_poa ("echo",
&this->servant_,
- env);
+ TAO_TRY_ENV);
ACE_DEBUG ((LM_DEBUG,
"The IOR is: <%s>\n",
str.in ()));
-
if (this->ior_output_file_)
{
ACE_OS::fprintf (this->ior_output_file_,
@@ -169,16 +158,15 @@ Server_i::init (int argc,
}
if (this->using_naming_service_)
- return this->init_naming_service (env);
-
+ return this->init_naming_service (TAO_TRY_ENV);
return 0;
}
int
-Server_i::run (CORBA::Environment &env)
+Server_i::run (CORBA::Environment &TAO_TRY_ENV)
{
// Run the main event loop for the ORB.
- if (this->orb_manager_.run (env) == -1)
+ if (this->orb_manager_.run (TAO_TRY_ENV) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"Server_i::run"),
-1);
diff --git a/TAO/examples/Simple/echo/run_test.pl b/TAO/examples/Simple/echo/run_test.pl
index 4869ff01f4e..890434e8aed 100755
--- a/TAO/examples/Simple/echo/run_test.pl
+++ b/TAO/examples/Simple/echo/run_test.pl
@@ -10,9 +10,8 @@ require Process;
$SV = Process::Create ("server$Process::EXE_EXT", " ");
-
-sleep($ACE::sleeptime);
-$status = system ("client$Process::EXE_EXT -x");
+sleep ($ACE::sleeptime);
+$status = system ("client$Process::EXE_EXT -x");
$SV->Kill (); $SV->Wait ();
diff --git a/TAO/examples/Simple/echo/server.cpp b/TAO/examples/Simple/echo/server.cpp
index 4fe88ccbf73..55f95757468 100644
--- a/TAO/examples/Simple/echo/server.cpp
+++ b/TAO/examples/Simple/echo/server.cpp
@@ -13,7 +13,6 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,
"\n\techo server\n\n"));
-
TAO_TRY
{
if (server.init (argc, argv, TAO_TRY_ENV) == -1)