summaryrefslogtreecommitdiff
path: root/TAO/tests/LongWrites/Receiver.cpp
blob: 6425de4a18a29f4560a31362b05109321bf1d050 (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
//
// $Id$
//
#include "Receiver.h"

ACE_RCSID(LongWrites, Receiver, "$Id$")

Receiver::Receiver (void)
  :  message_count_ (0)
  ,  byte_count_ (0)
{
}

void
Receiver::dump_results ()
{
  ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_);
  ACE_DEBUG ((LM_DEBUG,
              "Total messages = %d\n"
              "Total bytes = %d\n",
              this->message_count_,
              this->byte_count_));
}

void
Receiver::receive_data (const Test::Payload &payload,
                        CORBA::Environment &)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_);
  this->message_count_++;
  this->byte_count_ += payload.length ();

  ACE_DEBUG ((LM_DEBUG, "Receiver::receive_data\n"));
}