|
MADARA
3.2.3
|
#include <BasicASIOTransport.h>
Public Types | |
| typedef std::vector< std::string > | HostsVector |
| Used to define a vector of hosts to contact. More... | |
Public Member Functions | |
| BasicASIOTransport (const std::string &id, madara::knowledge::ThreadSafeContext &context, TransportSettings &config) | |
| ~BasicASIOTransport ()=0 | |
| int | check_transport (void) |
| all subclasses should call this method at the beginning of send_data More... | |
| void | close () override |
| Closes this transport. More... | |
| void | invalidate_transport (void) |
| Invalidates a transport to indicate it is shutting down. More... | |
| long | prep_send (const knowledge::VariableReferenceMap &orig_updates, const char *print_prefix) |
| Preps a message for sending. More... | |
| virtual long | send_data (const knowledge::VariableReferenceMap &)=0 |
| Sends a list of updates to the domain. More... | |
| TransportSettings & | settings (void) |
| Getter for the transport settings. More... | |
| int | setup () override |
| all subclasses should call this method at the end of its setup More... | |
| int | validate_transport (void) |
| Validates a transport to indicate it is not shutting down. More... | |
Static Public Attributes | |
| static const double | default_read_hertz |
Protected Member Functions | |
| virtual int | setup_read_socket () |
| virtual int | setup_read_thread (double hertz, const std::string &name)=0 |
| virtual int | setup_read_threads () |
| virtual int | setup_socket (udp::socket &socket) |
| virtual int | setup_sockets () |
| virtual int | setup_write_socket () |
Protected Attributes | |
| std::vector< udp::endpoint > | addresses_ |
| holds all multicast addresses we are sending to More... | |
| madara::utility::ScopedArray< char > | buffer_ |
| buffer for sending More... | |
| madara::knowledge::ThreadSafeContext & | context_ |
| HostsVector | hosts |
| const std::string | id_ |
| host:port identifier of this process More... | |
| asio::io_service | io_service_ |
| Boost::ASIO IO context. More... | |
| volatile bool | is_valid_ |
| knowledge::KnowledgeBase | knowledge_ |
| knowledge base for threads to use More... | |
| madara::expression::ExpressionTree | on_data_received_ |
| data received rules, defined in Transport settings More... | |
| PacketScheduler | packet_scheduler_ |
| scheduler for dropping packets to simulate network issues More... | |
| threads::Threader | read_threads_ |
| threads for reading knowledge updates More... | |
| BandwidthMonitor | receive_monitor_ |
| monitor for receiving bandwidth usage More... | |
| BandwidthMonitor | send_monitor_ |
| monitor for sending bandwidth usage More... | |
| QoSTransportSettings | settings_ |
| volatile bool | shutting_down_ |
| udp::socket | socket_ {io_service_} |
| underlying socket More... | |
Friends | |
| class | MulticastTransportReadThread |
| class | UdpTransportReadThread |
Definition at line 25 of file BasicASIOTransport.h.
|
inherited |
Used to define a vector of hosts to contact.
Definition at line 51 of file Transport.h.
| madara::transport::BasicASIOTransport::BasicASIOTransport | ( | const std::string & | id, |
| madara::knowledge::ThreadSafeContext & | context, | ||
| TransportSettings & | config | ||
| ) |
Definition at line 20 of file BasicASIOTransport.cpp.
|
pure virtual |
Definition at line 32 of file BasicASIOTransport.cpp.
|
inlineinherited |
all subclasses should call this method at the beginning of send_data
Definition at line 18 of file Transport.inl.
|
overridevirtual |
Closes this transport.
Reimplemented from madara::transport::Base.
Definition at line 38 of file BasicASIOTransport.cpp.
|
inlineinherited |
Invalidates a transport to indicate it is shutting down.
Definition at line 33 of file Transport.inl.
|
inherited |
Preps a message for sending.
| orig_updates | updates before send filtering is applied |
| print_prefix | prefix to include before every log message, e.g., "MyTransport::svc" |
filter the updates according to the filters specified by the user in QoSTransportSettings (if applicable)
size = buffer[0] (unsigned 64 bit) transport id = buffer[8] (8 byte) domain = buffer[16] (32 byte domain name) originator = buffer[48] (64 byte originator host:port) type = buffer[112] (unsigned 32 bit type of message–usually MULTIASSIGN) updates = buffer[116] (unsigned 32 bit number of updates) quality = buffer[120] (unsigned 32 bit quality of message) clock = buffer[124] (unsigned 64 bit clock for this message) ttl = buffer[132] (the new knowledge starts here) knowledge = buffer[133] (the new knowledge starts here)
Definition at line 812 of file Transport.cpp.
|
pure virtualinherited |
Sends a list of updates to the domain.
This function must be implemented by your transport
Default implementation constructs a KnowledgeRecords object and calls the deprecated version of send_data. This is expensive, so override this version instead.
Implemented in madara::transport::ZMQTransport, madara::transport::UdpRegistryClient, madara::transport::UdpTransport, madara::transport::SpliceDDSTransport, madara::transport::UdpRegistryServer, and madara::transport::NddsTransport.
|
inlineinherited |
Getter for the transport settings.
Definition at line 43 of file Transport.inl.
|
overridevirtual |
all subclasses should call this method at the end of its setup
Reimplemented from madara::transport::Base.
Reimplemented in madara::transport::UdpRegistryClient, and madara::transport::UdpRegistryServer.
Definition at line 50 of file BasicASIOTransport.cpp.
|
protectedvirtual |
Reimplemented in madara::transport::UdpTransport, and madara::transport::MulticastTransport.
Definition at line 192 of file BasicASIOTransport.cpp.
|
protectedpure virtual |
Implemented in madara::transport::UdpTransport, and madara::transport::MulticastTransport.
|
protectedvirtual |
Definition at line 220 of file BasicASIOTransport.cpp.
|
protectedvirtual |
Definition at line 123 of file BasicASIOTransport.cpp.
|
protectedvirtual |
Definition at line 205 of file BasicASIOTransport.cpp.
|
protectedvirtual |
Reimplemented in madara::transport::UdpTransport, and madara::transport::MulticastTransport.
Definition at line 198 of file BasicASIOTransport.cpp.
|
inlineinherited |
Validates a transport to indicate it is not shutting down.
Definition at line 6 of file Transport.inl.
|
friend |
Definition at line 65 of file BasicASIOTransport.h.
|
friend |
Definition at line 64 of file BasicASIOTransport.h.
|
protected |
holds all multicast addresses we are sending to
Definition at line 59 of file BasicASIOTransport.h.
|
protectedinherited |
buffer for sending
Definition at line 154 of file Transport.h.
|
protectedinherited |
Definition at line 136 of file Transport.h.
|
static |
Definition at line 38 of file BasicASIOTransport.h.
|
protectedinherited |
Definition at line 128 of file Transport.h.
|
protectedinherited |
host:port identifier of this process
Definition at line 131 of file Transport.h.
|
protected |
Boost::ASIO IO context.
Definition at line 53 of file BasicASIOTransport.h.
|
protectedinherited |
Definition at line 126 of file Transport.h.
|
protected |
knowledge base for threads to use
Definition at line 50 of file BasicASIOTransport.h.
|
protectedinherited |
data received rules, defined in Transport settings
Definition at line 140 of file Transport.h.
|
protectedinherited |
scheduler for dropping packets to simulate network issues
Definition at line 151 of file Transport.h.
|
protected |
threads for reading knowledge updates
Definition at line 56 of file BasicASIOTransport.h.
|
protectedinherited |
monitor for receiving bandwidth usage
Definition at line 148 of file Transport.h.
|
protectedinherited |
monitor for sending bandwidth usage
Definition at line 145 of file Transport.h.
|
protectedinherited |
Definition at line 133 of file Transport.h.
|
protectedinherited |
Definition at line 127 of file Transport.h.
|
protected |
underlying socket
Definition at line 62 of file BasicASIOTransport.h.