#include <StreamSink.hh>
This is a class for receiving messages from any number of remote stream sources. Any received message is acknowledged, and received messages are buffered until they are processed. Messages can either be polled for with pollData or blocked on with waitData.
Public Member Functions | |
StreamSink (int max_size, com_id_t stream_id, int max_buffer, com_id_t exclusive_client=0) | |
Message * | waitData (int msecs_timeout) |
Message * | pollData () |
void | releaseMsg (Message *) |
int | numToReceive () |
void | setBufferSize (int b) |
int | getBufferSize () const |
com_id_t | exclusiveClient () const |
int | getMaxSize () const |
com_id_t | getID () const |
void | flush () |
void | processMsg (com_id_t msg_id, RemoteManager *dest, TimeStamp receipt_time, Byte *buf, int len) |
|
This method flushes all messages in the queue waiting to be processed. All of the messages are released. |
|
This method returns the maximum number of messages that can be in the queue waiting to be processed. A negative number indicates that there is no limit. |
|
This method returns the stream ID. |
|
This method returns the maximum size of the messages in the stream |
|
This method returns the number of messages waiting to be received. |
|
This method checks if a new message has arrived. If so, it is returned, if not NULL is returned. |
|
This method sets the maximum number of messages that can be in the queue waiting to be processed. If this maximum queue size is going to be exceeded, the stream sink will throw away the oldest pending message. If "b" is -1, there is no limit and this is the initial value if you never call this method. |
|
This method waits for a message to arrive for up to "msecs_timeout" milliseconds and returns it. If no message arrives in that time, it returns NULL. |