diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2019-06-11 14:27:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-11 14:27:57 +0200 |
commit | 59df53784fe4f44d67e535dd47731590471205a6 (patch) | |
tree | a0b46c268d0bacec7893bb15622c6c69ef140e2f /TAO/orbsvcs/tests | |
parent | 45f4d9aa7873cffeb1f737b7e7aa86f054c9cee9 (diff) | |
parent | dde054ada9023d80ce42abe82f5dc92470d10624 (diff) | |
download | ATCD-59df53784fe4f44d67e535dd47731590471205a6.tar.gz |
Merge pull request #921 from jwillemsen/jwi-imr
When the ImR sendc_ping fails with a timeout mark the server as timedout instead of dead
Diffstat (limited to 'TAO/orbsvcs/tests')
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp b/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp index a3ff683ede1..45a56ca1902 100644 --- a/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp @@ -8,9 +8,24 @@ #include "tao/ImR_Client/ImR_Client.h" #include "ace/Get_Opt.h" +#include "ace/Task.h" #include "ace/streams.h" #include "ace/OS_NS_unistd.h" +class ORB_Runner : public ACE_Task_Base +{ +public: + explicit ORB_Runner (CORBA::ORB_ptr orb) : orb_(CORBA::ORB::_duplicate(orb)) {} + int svc (void) + { + this->orb_->run (); + return 0; + } + +private: + CORBA::ORB_var orb_; +}; + PortableServer::POA_var root_poa; PortableServer::POA_var poa_a; @@ -46,6 +61,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); + ORB_Runner *runner = new ORB_Runner (orb.in ()); int poa_delay = 10; int shutdown_delay = 0; @@ -79,6 +95,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); root_poa = PortableServer::POA::_narrow (obj.in ()); + runner->activate (); + ACE_CString base = ACE_CString ("TestObject"); createPOAs (base); @@ -120,10 +138,10 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) test_ior = orb->object_to_string (tva.in()); base += "_a"; - ACE_DEBUG ((LM_DEBUG, "(%P|%t) %C: %C\n", base.c_str(), test_ior.in())); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) %C:\n%C\n", base.c_str(), test_ior.in())); table->bind (base.c_str (), test_ior.in ()); - orb->run (); + runner->wait (); ACE_DEBUG ((LM_DEBUG, "(%P|%t) Destroying POA pid <%P>\n")); @@ -136,6 +154,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) return 1; } + delete runner; orb = CORBA::ORB::_nil (); ACE_OS::sleep (shutdown_delay); |