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.
Used to define a vector of hosts to contact.
Definition at line 51 of file Transport.h.
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.
int madara::transport::Base::check_transport |
( |
void |
| ) |
|
|
inlineinherited |
all subclasses should call this method at the beginning of send_data
Definition at line 18 of file Transport.inl.
void madara::transport::BasicASIOTransport::close |
( |
void |
| ) |
|
|
overridevirtualinherited |
void madara::transport::Base::invalidate_transport |
( |
void |
| ) |
|
|
inlineinherited |
Invalidates a transport to indicate it is shutting down.
Definition at line 33 of file Transport.inl.
virtual bool madara::transport::UdpTransport::pre_send_buffer |
( |
size_t |
addr_index | ) |
|
|
inlineprotectedvirtualinherited |
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 812 of file Transport.cpp.
int madara::transport::UdpTransport::reliability |
( |
void |
| ) |
const |
|
inherited |
Accesses reliability setting.
- Returns
- whether we are using reliable dissemination or not
Definition at line 23 of file UdpTransport.cpp.
int madara::transport::UdpTransport::reliability |
( |
const int & |
setting | ) |
|
|
inherited |
Sets the reliability setting.
- Returns
- the changed setting
Definition at line 29 of file UdpTransport.cpp.
long madara::transport::UdpTransport::send_buffer |
( |
const udp::endpoint & |
target, |
|
|
const char * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
protectedinherited |
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 33 of file UdpRegistryServer.cpp.
long madara::transport::UdpTransport::send_message |
( |
const char * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
protectedinherited |
Getter for the transport settings.
- Returns
- the current transport settings
Definition at line 43 of file Transport.inl.
int madara::transport::UdpRegistryServer::setup |
( |
void |
| ) |
|
|
overridevirtual |
int madara::transport::UdpTransport::setup_read_socket |
( |
void |
| ) |
|
|
overrideprotectedvirtualinherited |
int madara::transport::UdpTransport::setup_read_thread |
( |
double |
hertz, |
|
|
const std::string & |
name |
|
) |
| |
|
overrideprotectedvirtualinherited |
int madara::transport::BasicASIOTransport::setup_read_threads |
( |
| ) |
|
|
protectedvirtualinherited |
int madara::transport::BasicASIOTransport::setup_socket |
( |
udp::socket & |
socket | ) |
|
|
protectedvirtualinherited |
int madara::transport::BasicASIOTransport::setup_sockets |
( |
void |
| ) |
|
|
protectedvirtualinherited |
int madara::transport::UdpTransport::setup_write_socket |
( |
void |
| ) |
|
|
overrideprotectedvirtualinherited |
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.
std::vector<udp::endpoint> madara::transport::BasicASIOTransport::addresses_ |
|
protectedinherited |
const double madara::transport::BasicASIOTransport::default_read_hertz |
|
staticinherited |
const std::string madara::transport::Base::id_ |
|
protectedinherited |
host:port identifier of this process
Definition at line 131 of file Transport.h.
asio::io_service madara::transport::BasicASIOTransport::io_service_ |
|
protectedinherited |
volatile bool madara::transport::Base::is_valid_ |
|
protectedinherited |
data received rules, defined in Transport settings
Definition at line 140 of file Transport.h.
scheduler for dropping packets to simulate network issues
Definition at line 151 of file Transport.h.
const int madara::transport::UdpRegistryServer::PROFILES = 1 |
|
static |
monitor for receiving bandwidth usage
Definition at line 148 of file Transport.h.
monitor for sending bandwidth usage
Definition at line 145 of file Transport.h.
size_t madara::transport::UdpRegistryServer::server_count_ |
|
protected |
volatile bool madara::transport::Base::shutting_down_ |
|
protectedinherited |
udp::socket madara::transport::BasicASIOTransport::socket_ {io_service_} |
|
protectedinherited |
The documentation for this class was generated from the following files: