Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_3542_Regression / server.cpp
blobfbae206be4e1aa080a422905498c2251b8d704ae
1 #include "ace/ARGV.h"
2 #include "ace/Reactor.h"
3 #include "ace/Signal.h"
4 #include "ace/Service_Config.h"
5 #include "ace/Log_Msg.h"
7 ACE_TCHAR const * const scpc_loadOrb = ACE_DYNAMIC_SERVICE_DIRECTIVE(
8 "testDllOrb",
9 "Bug_3542",
10 "_make_DllOrb",
11 "testDllOrb -ORBDebugLevel 0 -ORBId testDllOrb -NumThreads 2 -ORBDottedDecimalAddresses 1 -ORBCollocationStrategy thru_poa"
14 ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE("testDllOrb");
16 int
17 ACE_TMAIN(int, ACE_TCHAR **)
19 int result = 0;
20 #if 0
21 ACE_Service_Config serviceConfig;
23 char signum[64];
24 ACE_OS::sprintf(signum, "%d", SIGUSR1);
26 ACE_ARGV args;
27 args.add(argv[0]);
28 args.add("-s");
29 args.add(signum);
31 result = serviceConfig.open (
32 args.argc(),
33 args.argv(),
34 ACE_DEFAULT_LOGGER_KEY,
35 1, // ignore_static_svcs = 1,
36 1, // ignore_default_svc_conf_file = 0,
37 0 // ignore_debug_flag = 0
39 if(0 != result)
41 ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Error: serviceConfig.open failed\n")));
42 return result;
44 ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) serviceConfig.open done\n")));
45 #endif
47 for(int cnt = 0; cnt < 1000; ++cnt)
49 ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) Loading ORB cnt = %d\n"), cnt));
50 result = ACE_Service_Config::process_directive(scpc_loadOrb);
51 if(0 != result)
53 ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Error loading ORB failed (%d)\n"), result));
54 return result;
56 ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) Loading ORB done\n")));
58 result = ACE_Service_Config::process_directive(scpc_unloadOrb);
59 if(0 != result)
61 ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Error unloading ORB failed (%d)\n"), result));
62 return result;
64 ACE_DEBUG ((LM_INFO, ACE_TEXT ("(%P|%t) Unloading ORB done\n")));
67 return result;