summaryrefslogtreecommitdiff
path: root/TAO/tests/Collocation_Tests/Client_Task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/Collocation_Tests/Client_Task.cpp')
-rw-r--r--TAO/tests/Collocation_Tests/Client_Task.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/TAO/tests/Collocation_Tests/Client_Task.cpp b/TAO/tests/Collocation_Tests/Client_Task.cpp
new file mode 100644
index 00000000000..aabba8b790e
--- /dev/null
+++ b/TAO/tests/Collocation_Tests/Client_Task.cpp
@@ -0,0 +1,55 @@
+//
+// $Id$
+//
+
+#include "Client_Task.h"
+#include "TestC.h"
+
+ACE_RCSID(Muxing, Client_Task, "$Id$")
+
+Client_Task::Client_Task (const char *ior,
+ CORBA::ORB_ptr corb,
+ ACE_Thread_Manager *thr_mgr)
+ : ACE_Task_Base (thr_mgr)
+ , input_ (ior)
+ , corb_ (CORBA::ORB::_duplicate (corb))
+
+{
+}
+
+int
+Client_Task::svc (void)
+{
+ try
+ {
+ CORBA::Object_var tmp =
+ this->corb_->string_to_object (input_);
+
+ Test::Hello_var hello =
+ Test::Hello::_narrow(tmp.in ());
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Nil Test::Hello reference <%s>\n",
+ input_),
+ 1);
+ }
+
+ CORBA::String_var the_string =
+ hello->get_string ();
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%s>\n",
+ the_string.in ()));
+
+ hello->shutdown ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught:");
+ return 1;
+ }
+
+ return 0;
+
+}