summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>1999-06-12 00:02:50 +0000
committerbala <balanatarajan@users.noreply.github.com>1999-06-12 00:02:50 +0000
commit7944c574c4c8825a5cdd9cbd2a71724dd7bcd216 (patch)
tree2e63dc81bdb91a856a8abe5f1f70fd2bce2fae02
parenteaa5a9af9a77a61a4256711164f36316ab662779 (diff)
downloadATCD-7944c574c4c8825a5cdd9cbd2a71724dd7bcd216.tar.gz
Wrote IOR to a file and made the client read the file in file:// format
-rw-r--r--TAO/examples/POA/TIE/client.cpp12
-rw-r--r--TAO/examples/POA/TIE/server.cpp46
2 files changed, 50 insertions, 8 deletions
diff --git a/TAO/examples/POA/TIE/client.cpp b/TAO/examples/POA/TIE/client.cpp
index a0b3ce6bd5e..3306844d5d4 100644
--- a/TAO/examples/POA/TIE/client.cpp
+++ b/TAO/examples/POA/TIE/client.cpp
@@ -34,22 +34,22 @@ parse_args (int argc, char **argv)
switch (c)
{
case 'a':
- IOR[1] = get_opts.optarg;
+ IOR[1] = ACE_OS::strdup (get_opts.optarg);
break;
case 'b':
- IOR[2] = get_opts.optarg;
+ IOR[2] = ACE_OS::strdup (get_opts.optarg);
break;
case 'c':
- IOR[3] = get_opts.optarg;
+ IOR[3] = ACE_OS::strdup (get_opts.optarg);
break;
case 'd':
- IOR[4] = get_opts.optarg;
+ IOR[4] = ACE_OS::strdup (get_opts.optarg);
break;
case 'e':
- IOR[5] = get_opts.optarg;
+ IOR[5] = ACE_OS::strdup (get_opts.optarg);
break;
case 'f':
- IOR[6] = get_opts.optarg;
+ IOR[6] = ACE_OS::strdup (get_opts.optarg);
break;
case 'i':
iterations = ::atoi (get_opts.optarg);
diff --git a/TAO/examples/POA/TIE/server.cpp b/TAO/examples/POA/TIE/server.cpp
index 6e6621b772e..12dfa0de4be 100644
--- a/TAO/examples/POA/TIE/server.cpp
+++ b/TAO/examples/POA/TIE/server.cpp
@@ -156,7 +156,7 @@ main (int argc, char **argv)
CORBA::String_var first_ior =
orb->object_to_string (a.in (), ACE_TRY_ENV);
ACE_TRY_CHECK;
-
+
// Stringyfy all the object references and print them out.
CORBA::String_var second_ior =
orb->object_to_string (b.in (), ACE_TRY_ENV);
@@ -167,12 +167,39 @@ main (int argc, char **argv)
orb->object_to_string (c.in (), ACE_TRY_ENV);
ACE_TRY_CHECK;
-
// Stringyfy all the object references and print them out.
CORBA::String_var forth_ior =
orb->object_to_string (a_tie.in (), ACE_TRY_ENV);
ACE_TRY_CHECK;
+ FILE *output_file_1 = ACE_OS::fopen ("ior_1", "w");
+ FILE *output_file_2 = ACE_OS::fopen ("ior_2", "w");
+ FILE *output_file_3 = ACE_OS::fopen ("ior_3", "w");
+ FILE *output_file_4 = ACE_OS::fopen ("ior_4", "w");
+
+ if (output_file_1)
+ {
+ cout << "I am here " << endl;
+ ACE_OS::fprintf (output_file_1,
+ "%s",
+ first_ior.in ());}
+ if (output_file_2)
+ ACE_OS::fprintf (output_file_2,
+ "%s",
+ second_ior.in ());
+ if (output_file_3)
+ ACE_OS::fprintf (output_file_3,
+ "%s",
+ third_ior.in ());
+ if (output_file_4)
+ ACE_OS::fprintf (output_file_4,
+ "%s",
+ forth_ior.in ());
+
+ ACE_OS::fclose (output_file_1);
+ ACE_OS::fclose (output_file_2);
+ ACE_OS::fclose (output_file_3);
+ ACE_OS::fclose (output_file_4);
#if defined (ACE_HAS_USING_KEYWORD)
@@ -187,6 +214,21 @@ main (int argc, char **argv)
orb->object_to_string (c_tie.in (), ACE_TRY_ENV);
ACE_TRY_CHECK;
+ FILE *output_file_5 = ACE_OS::fopen ("ior_5", "w");
+ FILE *output_file_6 = ACE_OS::fopen ("ior_6", "w");
+
+ if (output_file_5)
+ ACE_OS::fprintf (output_file_1,
+ "%s",
+ fifth_ior.in ());
+ if (output_file_6)
+ ACE_OS::fprintf (output_file_1,
+ "%s",
+ sixth_ior.in ());
+
+ ACE_OS::fclose (output_file_5);
+ ACE_OS::fclose (output_file_6);
+
#endif /* ACE_HAS_USING_KEYWORD */
ACE_DEBUG ((LM_DEBUG,