1 #include "ace/OS_main.h"
2 #include "ace/Naming_Context.h"
3 #include "ace/Log_Msg.h"
4 #include "ace/OS_NS_stdio.h"
5 #include "ace/OS_NS_unistd.h"
8 ACE_TMAIN (int argc
, ACE_TCHAR
**argv
)
10 const ACE_TCHAR
*host
= argc
> 1 ? argv
[1] : ACE_TEXT("-hlocalhost");
11 const ACE_TCHAR
*port
= argc
> 2 ? argv
[2] : ACE_TEXT("-p20012");
13 ACE_STATIC_SVC_REGISTER(ACE_Naming_Context
);
15 ACE_Naming_Context ns
;
16 ACE_Name_Options
*name_options
= ns
.name_options ();
18 const ACE_TCHAR
*m_argv
[] =
21 ACE_TEXT("-cNET_LOCAL"),
27 sizeof (m_argv
) / sizeof (ACE_TCHAR
*) -1;
29 name_options
->parse_args (m_argc
,
30 (ACE_TCHAR
**) m_argv
);
32 int result
= ns
.open (ACE_Naming_Context::NET_LOCAL
);
34 "ACE_Naming_Context::open returned %d\n",
49 for (int l
= 1; l
<= 1000 ; l
++)
53 (int) ACE_OS::getpid (),
62 "%d: bind of %s: %d\n",
73 "ACE_Naming_Context::close returned %d\n",