1 #ifndef _MADARA_UDP_TRANSPORT_READ_THREAD_H_ 2 #define _MADARA_UDP_TRANSPORT_READ_THREAD_H_ 16 #include "ace/Mutex.h" 17 #include "ace/Barrier.h" 18 #include "ace/Atomic_Op_T.h" 19 #include "ace/Thread_Mutex.h" 21 #include "ace/Synch.h" 22 #include "ace/INET_Addr.h" 23 #include "ace/SOCK_Dgram.h" 52 std::map <std::string, ACE_INET_Addr> & addresses,
53 ACE_SOCK_Dgram & write_socket,
54 ACE_SOCK_Dgram & read_socket,
84 const char * print_prefix,
107 #ifndef _MADARA_NO_KARL_ 110 #endif // _MADARA_NO_KARL_ 127 #endif // _MADARA_UDP_TRANSPORT_READ_THREAD_H_ const QoSTransportSettings settings_
Transport settings.
ACE_SOCK_Dgram & read_socket_
The socket we are reading from.
void rebroadcast(const char *print_prefix, MessageHeader *header, const knowledge::KnowledgeMap &records)
Sends a rebroadcast packet to all peers.
const std::string id_
host:port identifier of this process
BandwidthMonitor & receive_monitor_
monitor for receiving bandwidth usage
This class stores variables and their values for use by any entity needing state information in a thr...
madara::knowledge::CompiledExpression on_data_received_
data received rules, defined in Transport settings
Provides scheduler for dropping packets.
knowledge::ThreadSafeContext * context_
knowledge context
Holds basic transport settings.
Compiled, optimized KaRL logic.
std::map< std::string, ACE_INET_Addr > & addresses_
internet addresses of our peers
void init(knowledge::KnowledgeBase &knowledge)
Initializes MADARA context-related items.
ACE_SOCK_Dgram & write_socket_
The socket we are writing to.
Abstract base class for implementing threads.
This class provides a distributed knowledge base to users.
::std::map< std::string, KnowledgeRecord > KnowledgeMap
BandwidthMonitor & send_monitor_
monitor for sending bandwidth usage
void run(void)
The main loop internals for the read thread.
Container for quality-of-service settings.
Provides monitoring capability of a transport's bandwidth.
Provides functions and classes for the distributed knowledge base.
madara::utility::ScopedArray< char > buffer_
buffer for sending
UdpTransportReadThread(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.
Copyright (c) 2015 Carnegie Mellon University.
void cleanup(void)
Cleanup function called by thread manager.
Thread for reading knowledge updates through a UDP socket.
PacketScheduler & packet_scheduler_
scheduler for mimicking target network conditions