summaryrefslogtreecommitdiff
path: root/TAO/tests/Oneways_Invoking_Twoways/Sender_i.cpp
blob: db8f1552168bc54684c0cfda87bcb677448ed5ab (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
49
50
51
52
53
54
55
56
57
58
59
60
#include "Sender_i.h"

ACE_RCSID(Oneways_Invoking_Twoways, Sender_i, "$Id$")

Sender_i::Sender_i (CORBA::ORB_ptr orb,
                    CORBA::ULong no)
  : orb_ (CORBA::ORB::_duplicate (orb)),
    number_ (no),
    active_objects_ (0)
{
}

Sender_i::~Sender_i (void)
{
}

void
Sender_i::active_objects (CORBA::Short no_threads,
                          CORBA::Environment & /*ACE_TRY_ENV */ )
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  this->active_objects_ = no_threads;
}


void
Sender_i::send_ready_message (Test::Receiver_ptr receiver,
                              CORBA::Environment &ACE_TRY_ENV)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  CORBA::ULong call_count = 0;

  ACE_DEBUG ((LM_DEBUG,
              "Received a call ...\n"));

  ACE_DEBUG ((LM_DEBUG,
              "Calling the Receiver ..\n"));

  for (CORBA::ULong i = 0;
       i < this->number_;
       ++i)
    {
      call_count = receiver->receive_call (ACE_TRY_ENV);
      ACE_CHECK;
    }

  /*if (call_count >= 8000)
  {
      // Shutdown the remote object
      // receiver->shutdown (ACE_TRY_ENV);
      // ACE_CHECK;
      }*/
}

void
Sender_i::ping (CORBA::Environment & /*ACE_TRY_ENV*/)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  return;
}