blob: 8865ae101b807516b36e05689ee8eeafebf9838f (
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 main( int argc, char *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( CORBA::Exception& )
{
return 1 ;
}
}
catch( CORBA::Exception& )
{
return 2 ;
}
return 0 ;
}
|