MADARA
3.4.1
|
Thread for reading knowledge updates through a ZMQ datagram socket. More...
#include <ZMQTransportReadThread.h>
Public Member Functions | |
ZMQTransportReadThread (const TransportSettings &settings, const std::string &id, void *write_socket, BandwidthMonitor &send_monitor, BandwidthMonitor &receive_monitor, PacketScheduler &packet_scheduler) | |
Constructor. More... | |
void | cleanup (void) |
Cleanup function called by thread manager. More... | |
void | init (knowledge::KnowledgeBase &knowledge) |
Initializes MADARA context-related items. More... | |
void | rebroadcast (const char *print_prefix, MessageHeader *header, const knowledge::KnowledgeMap &records) |
Sends a rebroadcast packet. More... | |
void | run (void) |
The main loop internals for the read thread. More... | |
Protected Member Functions | |
virtual void | init_control_vars (knowledge::KnowledgeBase &control) |
Initializes the thread implementation's control plane variables. More... | |
Protected Attributes | |
std::string | name |
The unique name of your thread. More... | |
madara::knowledge::containers::Integer | paused |
thread safe paused flag that may be set by the Threader More... | |
madara::knowledge::containers::Integer | terminated |
thread safe terminated flag that may be set by the Threader base More... | |
Thread for reading knowledge updates through a ZMQ datagram socket.
Definition at line 34 of file ZMQTransportReadThread.h.
madara::transport::ZMQTransportReadThread::ZMQTransportReadThread | ( | const TransportSettings & | settings, |
const std::string & | id, | ||
void * | write_socket, | ||
BandwidthMonitor & | send_monitor, | ||
BandwidthMonitor & | receive_monitor, | ||
PacketScheduler & | packet_scheduler | ||
) |
Constructor.
settings | Transport settings |
id | host:port identifier of this process, to allow for rejection of duplicates |
write_socket | socket for sending |
send_monitor | bandwidth monitor for enforcing send limits |
receive_monitor | bandwidth monitor for enforcing receive limits |
packet_scheduler | scheduler for mimicking network conditions |
Definition at line 11 of file ZMQTransportReadThread.cpp.
|
virtual |
Cleanup function called by thread manager.
Reimplemented from madara::threads::BaseThread.
Definition at line 216 of file ZMQTransportReadThread.cpp.
|
virtual |
Initializes MADARA context-related items.
knowledge | context for querying current program state |
Reimplemented from madara::threads::BaseThread.
Definition at line 26 of file ZMQTransportReadThread.cpp.
|
inlineprotectedvirtualinherited |
Initializes the thread implementation's control plane variables.
control | the control plane between Threader and threads |
Reimplemented in madara::threads::JavaThread.
Definition at line 78 of file BaseThread.h.
void madara::transport::ZMQTransportReadThread::rebroadcast | ( | const char * | print_prefix, |
MessageHeader * | header, | ||
const knowledge::KnowledgeMap & | records | ||
) |
Sends a rebroadcast packet.
print_prefix | prefix to include before every log message, e.g., "MyTransport::svc" |
header | header for the rebroadcasted packet |
records | records to rebroadcast (already filtered for rebroadcast) |
Definition at line 245 of file ZMQTransportReadThread.cpp.
|
virtual |
The main loop internals for the read thread.
Implements madara::threads::BaseThread.
Definition at line 280 of file ZMQTransportReadThread.cpp.
|
private |
buffer for receiving
Definition at line 101 of file ZMQTransportReadThread.h.
|
private |
knowledge context
Definition at line 87 of file ZMQTransportReadThread.h.
|
private |
bad receives
Definition at line 116 of file ZMQTransportReadThread.h.
|
private |
host:port identifier of this process
Definition at line 84 of file ZMQTransportReadThread.h.
|
protectedinherited |
The unique name of your thread.
Definition at line 90 of file BaseThread.h.
|
private |
data received rules, defined in Transport settings
Definition at line 97 of file ZMQTransportReadThread.h.
|
private |
scheduler for mimicking target network conditions
Definition at line 110 of file ZMQTransportReadThread.h.
|
protectedinherited |
thread safe paused flag that may be set by the Threader
Definition at line 101 of file BaseThread.h.
|
private |
The multicast socket we are reading from.
Definition at line 93 of file ZMQTransportReadThread.h.
|
private |
monitor for receiving bandwidth usage
Definition at line 107 of file ZMQTransportReadThread.h.
|
private |
received data
Definition at line 119 of file ZMQTransportReadThread.h.
|
private |
max data received
Definition at line 122 of file ZMQTransportReadThread.h.
|
private |
min data received
Definition at line 125 of file ZMQTransportReadThread.h.
|
private |
received packets
Definition at line 113 of file ZMQTransportReadThread.h.
|
private |
monitor for sending bandwidth usage
Definition at line 104 of file ZMQTransportReadThread.h.
|
private |
quality-of-service transport settings
Definition at line 81 of file ZMQTransportReadThread.h.
|
protectedinherited |
thread safe terminated flag that may be set by the Threader base
Definition at line 96 of file BaseThread.h.
|
private |
underlying socket for sending
Definition at line 90 of file ZMQTransportReadThread.h.