UDP-based server that handles a registry of UDP endpoints, which makes it ideal for any NAT-protected agents.
More...
#include <UdpRegistryServer.h>
UDP-based server that handles a registry of UDP endpoints, which makes it ideal for any NAT-protected agents.
Definition at line 24 of file UdpRegistryServer.h.
◆ HostsVector
Used to define a vector of hosts to contact.
Definition at line 51 of file Transport.h.
◆ anonymous enum
◆ UdpRegistryServer()
Constructor.
- Parameters
-
id | unique identifer - usually a combination of host:port |
context | knowledge context |
config | transport configuration settings |
launch_transport | whether or not to launch this transport |
Definition at line 10 of file UdpRegistryServer.cpp.
◆ check_transport()
int madara::transport::Base::check_transport |
( |
void |
| ) |
|
|
inlineinherited |
all subclasses should call this method at the beginning of send_data
Definition at line 17 of file Transport.inl.
◆ close()
void madara::transport::BasicASIOTransport::close |
( |
void |
| ) |
|
|
overridevirtualinherited |
◆ get_udp_endpoints()
const std::vector<udp::endpoint>& madara::transport::BasicASIOTransport::get_udp_endpoints |
( |
void |
| ) |
|
|
inlineinherited |
◆ invalidate_transport()
void madara::transport::Base::invalidate_transport |
( |
void |
| ) |
|
|
inlineinherited |
Invalidates a transport to indicate it is shutting down.
Definition at line 31 of file Transport.inl.
◆ pre_send_buffer()
virtual bool madara::transport::UdpTransport::pre_send_buffer |
( |
size_t |
addr_index | ) |
|
|
inlineprotectedvirtualinherited |
◆ prep_send()
long madara::transport::Base::prep_send |
( |
const knowledge::KnowledgeMap & |
orig_updates, |
|
|
const char * |
print_prefix |
|
) |
| |
|
inherited |
Preps a message for sending.
- Parameters
-
orig_updates | updates before send filtering is applied |
print_prefix | prefix to include before every log message, e.g., "MyTransport::svc" |
- Returns
- -1 Transport is shutting down
-2 Transport is invalid
-3 Unable to allocate send buffer
0 No message to send > 0 size of buffered message
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 860 of file Transport.cpp.
◆ receive_buffer()
long madara::transport::UdpTransport::receive_buffer |
( |
char * |
buf, |
|
|
size_t & |
bytes_read, |
|
|
udp::endpoint & |
remote |
|
) |
| |
|
inherited |
Receives a buffer from a remote host.
- Parameters
-
buf | buffer to fill with data |
bytes_read | number of bytes read |
remote | remote endpoint that sent message |
- Returns
- 0 if success, 1 if socket busy, or 2 if unknown error
Definition at line 101 of file UdpTransport.cpp.
◆ reliability() [1/2]
int madara::transport::UdpTransport::reliability |
( |
const int & |
setting | ) |
|
|
inherited |
Sets the reliability setting.
- Returns
- the changed setting
Definition at line 42 of file UdpTransport.cpp.
◆ reliability() [2/2]
int madara::transport::UdpTransport::reliability |
( |
void |
| ) |
const |
|
inherited |
Accesses reliability setting.
- Returns
- whether we are using reliable dissemination or not
Definition at line 37 of file UdpTransport.cpp.
◆ send_buffer()
long madara::transport::UdpTransport::send_buffer |
( |
const udp::endpoint & |
target, |
|
|
const char * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inherited |
Sends a buffer to a host endpoint.
- Parameters
-
buf | buffer to send |
size | number of bytes to send |
target | remote endpoint to send to |
- Returns
- 0 if success, 1 if socket busy, or 2 if unknown error
Definition at line 130 of file UdpTransport.cpp.
◆ send_data()
Sends a list of knowledge updates to listeners.
- Parameters
-
updates | listing of all updates that must be sent |
- Returns
- result of write operation or -1 if we are shutting down
Implements madara::transport::Base.
Definition at line 32 of file UdpRegistryServer.cpp.
◆ send_message()
long madara::transport::UdpTransport::send_message |
( |
const char * |
buf, |
|
|
size_t |
size, |
|
|
uint64_t |
clock |
|
) |
| |
|
protectedinherited |
◆ settings()
Getter for the transport settings.
- Returns
- the current transport settings
Definition at line 40 of file Transport.inl.
◆ setup()
int madara::transport::UdpRegistryServer::setup |
( |
void |
| ) |
|
|
overridevirtual |
◆ setup_read_socket()
int madara::transport::UdpTransport::setup_read_socket |
( |
void |
| ) |
|
|
overrideprotectedvirtualinherited |
◆ setup_read_thread()
int madara::transport::UdpTransport::setup_read_thread |
( |
double |
hertz, |
|
|
const std::string & |
name |
|
) |
| |
|
overrideprotectedvirtualinherited |
◆ setup_read_threads()
int madara::transport::BasicASIOTransport::setup_read_threads |
( |
| ) |
|
|
protectedvirtualinherited |
◆ setup_socket()
int madara::transport::BasicASIOTransport::setup_socket |
( |
udp::socket & |
socket | ) |
|
|
protectedvirtualinherited |
◆ setup_sockets()
int madara::transport::BasicASIOTransport::setup_sockets |
( |
void |
| ) |
|
|
protectedvirtualinherited |
◆ setup_write_socket()
int madara::transport::UdpTransport::setup_write_socket |
( |
void |
| ) |
|
|
overrideprotectedvirtualinherited |
◆ validate_transport()
int madara::transport::Base::validate_transport |
( |
void |
| ) |
|
|
inlineinherited |
Validates a transport to indicate it is not shutting down.
Definition at line 6 of file Transport.inl.
◆ addresses_
std::vector<udp::endpoint> madara::transport::BasicASIOTransport::addresses_ |
|
protectedinherited |
◆ buffer_
◆ context_
◆ default_read_hertz
const double madara::transport::BasicASIOTransport::default_read_hertz |
|
staticinherited |
◆ endpoints_
◆ enforcer_
enforces epochs when user specifies a max_send_hertz
Definition at line 112 of file UdpTransport.h.
◆ failed_sends
◆ hosts
◆ id_
const std::string madara::transport::Base::id_ |
|
protectedinherited |
host:port identifier of this process
Definition at line 130 of file Transport.h.
◆ io_service_
asio::io_service madara::transport::BasicASIOTransport::io_service_ |
|
protectedinherited |
◆ is_valid_
volatile bool madara::transport::Base::is_valid_ |
|
protectedinherited |
◆ knowledge_
◆ last_toi_sent_
uint64_t madara::transport::Base::last_toi_sent_ = 0 |
|
protectedinherited |
Latest TOI the previous send operation included.
Definition at line 156 of file Transport.h.
◆ on_data_received_
data received rules, defined in Transport settings
Definition at line 139 of file Transport.h.
◆ packet_scheduler_
scheduler for dropping packets to simulate network issues
Definition at line 150 of file Transport.h.
◆ PROFILES
const int madara::transport::UdpRegistryServer::PROFILES = 1 |
|
static |
◆ read_threads_
◆ receive_monitor_
monitor for receiving bandwidth usage
Definition at line 147 of file Transport.h.
◆ send_monitor_
monitor for sending bandwidth usage
Definition at line 144 of file Transport.h.
◆ sent_data
◆ sent_data_max
◆ sent_data_min
◆ sent_packets
◆ server_count_
size_t madara::transport::UdpRegistryServer::server_count_ |
|
protected |
◆ settings_
◆ shutting_down_
volatile bool madara::transport::Base::shutting_down_ |
|
protectedinherited |
◆ socket_
udp::socket madara::transport::BasicASIOTransport::socket_ {io_service_} |
|
protectedinherited |
The documentation for this class was generated from the following files: