| MADARA
    3.1.8
    | 
Thread for reading registry updates through a UDP socket. More...
#include <UdpRegistryServerReadThread.h>


| Public Member Functions | |
| UdpRegistryServerReadThread (const TransportSettings &settings, const std::string &id, std::map< std::string, ACE_INET_Addr > &addresses, ACE_SOCK_Dgram &write_socket, ACE_SOCK_Dgram &read_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 to all peers.  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 Java 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... | |
| Private Attributes | |
| std::map< std::string, ACE_INET_Addr > & | addresses_ | 
| internet addresses of our peers  More... | |
| madara::utility::ScopedArray< char > | buffer_ | 
| buffer for sending  More... | |
| knowledge::ThreadSafeContext * | context_ | 
| knowledge context  More... | |
| const std::string | id_ | 
| host:port identifier of this process  More... | |
| madara::knowledge::CompiledExpression | on_data_received_ | 
| data received rules, defined in Transport settings  More... | |
| PacketScheduler & | packet_scheduler_ | 
| scheduler for mimicking target network conditions  More... | |
| ACE_SOCK_Dgram & | read_socket_ | 
| The socket we are reading from.  More... | |
| BandwidthMonitor & | receive_monitor_ | 
| monitor for receiving bandwidth usage  More... | |
| BandwidthMonitor & | send_monitor_ | 
| monitor for sending bandwidth usage  More... | |
| const QoSTransportSettings | settings_ | 
| Transport settings.  More... | |
| ACE_SOCK_Dgram & | write_socket_ | 
| The socket we are writing to.  More... | |
Thread for reading registry updates through a UDP socket.
Definition at line 33 of file UdpRegistryServerReadThread.h.
| madara::transport::UdpRegistryServerReadThread::UdpRegistryServerReadThread | ( | const TransportSettings & | settings, | 
| const std::string & | id, | ||
| std::map< std::string, ACE_INET_Addr > & | addresses, | ||
| ACE_SOCK_Dgram & | write_socket, | ||
| ACE_SOCK_Dgram & | read_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 | 
| addresses | the ACE socket addresses to communicate with | 
| write_socket | socket for sending | 
| read_socket | socket for receiving | 
| 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 9 of file UdpRegistryServerReadThread.cpp.
| 
 | virtual | 
Cleanup function called by thread manager.
Reimplemented from madara::threads::BaseThread.
Definition at line 322 of file UdpRegistryServerReadThread.cpp.
| 
 | virtual | 
Initializes MADARA context-related items.
| knowledge | context for querying current program state | 
Reimplemented from madara::threads::BaseThread.
Definition at line 31 of file UdpRegistryServerReadThread.cpp.
| 
 | inlineprotectedvirtualinherited | 
Initializes the Java thread implementation's control plane variables.
| control | the control plane between Threader and threads | 
Reimplemented in madara::threads::JavaThread.
Definition at line 86 of file BaseThread.h.
| void madara::transport::UdpRegistryServerReadThread::rebroadcast | ( | const char * | print_prefix, | 
| MessageHeader * | header, | ||
| const knowledge::KnowledgeMap & | records | ||
| ) | 
Sends a rebroadcast packet to all peers.
| 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 66 of file UdpRegistryServerReadThread.cpp.
| 
 | virtual | 
The main loop internals for the read thread.
Implements madara::threads::BaseThread.
Definition at line 328 of file UdpRegistryServerReadThread.cpp.
| 
 | private | 
internet addresses of our peers
Definition at line 99 of file UdpRegistryServerReadThread.h.
| 
 | private | 
buffer for sending
Definition at line 113 of file UdpRegistryServerReadThread.h.
| 
 | private | 
knowledge context
Definition at line 96 of file UdpRegistryServerReadThread.h.
| 
 | private | 
host:port identifier of this process
Definition at line 93 of file UdpRegistryServerReadThread.h.
| 
 | protectedinherited | 
The unique name of your thread.
Definition at line 96 of file BaseThread.h.
| 
 | private | 
data received rules, defined in Transport settings
Definition at line 109 of file UdpRegistryServerReadThread.h.
| 
 | private | 
scheduler for mimicking target network conditions
Definition at line 122 of file UdpRegistryServerReadThread.h.
| 
 | protectedinherited | 
thread safe paused flag that may be set by the Threader
Definition at line 107 of file BaseThread.h.
| 
 | private | 
The socket we are reading from.
Definition at line 105 of file UdpRegistryServerReadThread.h.
| 
 | private | 
monitor for receiving bandwidth usage
Definition at line 119 of file UdpRegistryServerReadThread.h.
| 
 | private | 
monitor for sending bandwidth usage
Definition at line 116 of file UdpRegistryServerReadThread.h.
| 
 | private | 
Transport settings.
Definition at line 90 of file UdpRegistryServerReadThread.h.
| 
 | protectedinherited | 
thread safe terminated flag that may be set by the Threader base
Definition at line 102 of file BaseThread.h.
| 
 | private | 
The socket we are writing to.
Definition at line 102 of file UdpRegistryServerReadThread.h.