summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/Bug_3646a_Regression/Consumer.cpp
blob: 061ee286b3a2e2b60b7a9453ef56c2f3de4f2cbc (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
39
40
41
42
43
44
45
46
47
48
// $Id$

// ******************************************************************
// Include Section
// ******************************************************************

#include "Notify_Test_Client.h"

#include "ace/Get_Opt.h"
#include "ace/Argv_Type_Converter.h"

int
ACE_TMAIN (int argc, ACE_TCHAR* argv[])
{
  int status = 0;
  try
    {
      Notify_Test_Client client;
      ACE_Argv_Type_Converter argcon (argc, argv);
      status = client.init (argcon.get_argc (), argcon.get_TCHAR_argv ());

      if (status == 0)
        {
          CosNaming::NamingContext_ptr naming = client.naming_context ();
          if (CORBA::is_nil (naming))
            {
              ACE_ERROR_RETURN ((LM_ERROR,
                                 "Can't find naming service\n"),
                                1);
            }

          CosNaming::Name name (1);
          name.length (1);
          name[0].id = CORBA::string_dup ("Channel1");
          CORBA::Object_var obj1 = naming->resolve (name);

          name[0].id = CORBA::string_dup ("Channel2");
          CORBA::Object_var obj2 = naming->resolve (name);
        }
    }
  catch (const CORBA::Exception& e)
    {
      e._tao_print_exception ("Error: ");
      status = 1;
    }

  return status;
}