summaryrefslogtreecommitdiff
path: root/examples/CORBA/server.cpp
blob: ff07fe26849336a7f2574fb4a9d5a6c97194ebb0 (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
#include "ace/Service_Config.h"
// $Id$

#include "ace/CORBA_Handler.h"
#include "Test_i.h"

#if defined (ACE_HAS_ORBIX)

#if defined (ACE_HAS_MT_ORBIX)
typedef ACE_MT_CORBA_Handler CORBA_HANDLER;
#else
typedef ACE_ST_CORBA_Handler CORBA_HANDLER;
#endif /* ACE_HAS_MT_ORBIX */

int 
main (int argc, char *argv[])
{
  ACE_Service_Config daemon;

  char pwd[BUFSIZ];
  char app[BUFSIZ];

  ACE_OS::getcwd (pwd, sizeof pwd);
  ACE_OS::sprintf (app, "%s/%s", pwd, argv[0]);

  if (CORBA_HANDLER::instance ()->activate_service (Test_IMPL, 0, app) == -1)
    ACE_ERROR_RETURN ((LM_ERROR, "Could not activate services for supplier\n"), -1);

  TIE_Test (Test_i) test (new Test_i);
  
  for (;;)
    if (CORBA_HANDLER::instance ()->reactor ()->handle_events () == -1)
      break;

  return 0;
}
#endif /* ACE_HAS_ORBIX */