1 #include "Oneway_Buffering_Admin.h"
2 #include "ace/OS_NS_unistd.h"
6 const unsigned int timeout_in_sec
= 2u;
9 Oneway_Buffering_Admin::Oneway_Buffering_Admin (CORBA::ORB_ptr orb
)
10 : orb_ (CORBA::ORB::_duplicate (orb
))
12 , bytes_received_count_ (0)
17 Oneway_Buffering_Admin::request_count (CORBA::ULong expected_request_count
)
19 ACE_Time_Value
timeout (timeout_in_sec
);
20 while ( (this->request_count_
< expected_request_count
)
21 && (ACE_Time_Value::zero
< timeout
) )
23 orb_
->perform_work (timeout
); // Do some work, decreases timeout for amount done.
25 return this->request_count_
;
29 Oneway_Buffering_Admin::bytes_received_count (CORBA::ULong expected_bytes_received_count
)
31 ACE_Time_Value
timeout (timeout_in_sec
);
32 while ( (this->bytes_received_count_
< expected_bytes_received_count
)
33 && (ACE_Time_Value::zero
< timeout
) )
35 orb_
->perform_work (timeout
); // Do some work, decreases timeout for amount done.
37 return this->bytes_received_count_
;
41 Oneway_Buffering_Admin::request_received (CORBA::ULong payload_length
)
43 this->request_count_
++;
44 this->bytes_received_count_
+= payload_length
;
48 Oneway_Buffering_Admin::flush (void)
53 Oneway_Buffering_Admin::shutdown (void)
55 this->orb_
->shutdown (0);