summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/AMH_AMI/inner_i.cpp
blob: 5ac86f746f227a848952ce82dc8b95f2c3850297 (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
/* -*- C++ -*-  */
#include "amh_ami_pch.h"

#include "inner_i.h"
#include "ace/OS_NS_unistd.h"

Inner_i::Inner_i (int d)
  : divisor_ (d)
{
}

char *
Inner_i::answer (const char * question)
{
  ACE_UNUSED_ARG (question); // doesn't matter

  CORBA::String_var answer =
    CORBA::string_dup ("I didn't know dogs could talk!");

  int delay = 5/this->divisor_; // throw exception if divisor = 0

  ACE_OS::sleep(delay); // make the caller wait a bit
  return answer._retn();
}