forked from dase/CLAIMS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimeOutReceiver.h
executable file
·30 lines (28 loc) · 1.1 KB
/
TimeOutReceiver.h
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
/*
* TimeOutReceiver.h
* The class extends Theron::Receiver by supporting timeout Wait.
* Created on: Oct 25, 2013
* Author: wangli
*/
#include <Theron/Theron.h>
#ifndef TIMEOUTRECEIVER_H_
#define TIMEOUTRECEIVER_H_
class TimeOutReceiver:public Theron::Receiver {
public:
TimeOutReceiver(Theron::EndPoint *endpoint);
TimeOutReceiver(Theron::EndPoint *endpoint,const char* name);
virtual ~TimeOutReceiver();
/**
* This function supports timeout Wait.
* The calling of this method will be blocked until one of the following conditions satisfied.
* (1) expected number of messages are received before the timeout. Then the return value is the number
* of expected messages.
* (2) The time is out before expected number of messages are received. Then the return value is the number
* of received messages.
* E.g., TimeOutWait(10,1000)==10 will return true if 10 messages are received within 1 second, and will false
* if less than 10 messages are received within 1 second.
*
*/
unsigned TimeOutWait(unsigned expected_message_count,unsigned time_out_in_ms);
};
#endif /* TIMEOUTRECEIVER_H_ */