blob: 82bc24276b5bc90e5cc9a3e27cedc6c397513cc7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
//
// $Id$
//
#include "tao/corba.h"
// Attempts to resolve the NameService.
// Returns:
// 0 if the NameService was resolved
// 1 if the NameService could not be resolved
// 2 if something else went wrong
//
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
try
{
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
try
{
CORBA::Object_var naming =
orb->resolve_initial_references ("NameService");
if (CORBA::is_nil (naming.in ()))
{
return 1;
}
}
catch (const CORBA::Exception&)
{
return 1;
}
}
catch (const CORBA::Exception&)
{
return 2;
}
return 0;
}
|