blob: 2e60841de9bbd831498ce46fed9a9bd7147b909d (
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
61
|
#include "McastHello.h"
McastHello::McastHello (CORBA::ORB_ptr orb,
int instance)
: orb_ (CORBA::ORB::_duplicate (orb)),
instance_ (instance),
small_request_status_ (0),
large_request_status_ (0)
{
}
void
McastHello::send_forty_two (CORBA::Long forty_two)
{
if (this->small_request_status_ == 0 &&
forty_two == 42)
{
this->small_request_status_ = 1;
}
else
this->small_request_status_ = 0;
}
void
McastHello::send_large_octet_array (const Test::Octets &payload)
{
CORBA::Boolean valid_payload = 1;
for (CORBA::ULong i = 0; i < payload.length (); ++i)
{
if ((CORBA::ULong) payload [i] != i % 256)
{
ACE_ERROR ((LM_ERROR,
"ERROR: (%P|%t) McastHello::send_large_octet_array, "
"unexpected value at index %d (%d != %d)\n",
i, payload [i], i % 256));
valid_payload = 0;
break;
}
}
if (this->large_request_status_ == 0 &&
valid_payload == 1)
{
this->large_request_status_ = 1;
}
else
this->large_request_status_ = 0;
}
void
McastHello::shutdown (void)
{
this->orb_->shutdown (false);
}
CORBA::Boolean
McastHello::get_status ()
{
return this->large_request_status_ && this->small_request_status_;
}
|