Class ILLIXR::tcp_network_backend
ClassList > ILLIXR > tcp_network_backend
#include <plugin.hpp>
Inherits the following classes: ILLIXR::plugin, ILLIXR::network::tcp_backend
Public Attributes
| Type | Name |
|---|---|
| bool | client |
Public Functions
| Type | Name |
|---|---|
| virtual bool | is_topic_networked (std::string topic_name) override |
| void | read_loop (network::TCPSocket * socket) |
| virtual void | start_client () override |
| virtual void | start_server () override |
| virtual void | stop () override |
| tcp_network_backend (const std::string & name_, phonebook * pb_) |
|
| virtual void | topic_create (std::string topic_name, network::topic_config & config) override |
| void | topic_receive (const std::string & topic_name, std::vector< char > & message) |
| virtual void | topic_send (std::string topic_name, std::string && message) override |
| virtual network::topic_config::TransportMethod | transport_method () override const |
| ~tcp_network_backend () override |
Public Functions inherited from ILLIXR::plugin
See ILLIXR::plugin
| Type | Name |
|---|---|
| std::string | get_name () noexcept const |
| plugin (std::string name, phonebook * pb) |
|
| void | spd_add_file_sink (const std::string & file_name, const std::string & extension, const std::string & log_level) |
| auto | spdlogger (const char * log_level) |
| virtual void | start () A method which Spindle calls when it starts the component. |
| virtual void | stop () A method which Spindle calls when it stops the component. |
| virtual | ~plugin () = default |
Public Functions inherited from ILLIXR::network::network_backend
See ILLIXR::network::network_backend
| Type | Name |
|---|---|
| virtual bool | is_topic_networked (std::string topic_name) = 0 |
| virtual void | start_client () = 0 |
| virtual void | start_server () = 0 |
| virtual void | topic_create (std::string topic_name, topic_config & config) = 0 |
| virtual void | topic_send (std::string topic_name, std::string && message) = 0 |
| virtual network::topic_config::TransportMethod | transport_method () const = 0 |
Public Functions inherited from ILLIXR::phonebook::service
See ILLIXR::phonebook::service
| Type | Name |
|---|---|
| virtual | ~service () = default |
Protected Attributes inherited from ILLIXR::plugin
See ILLIXR::plugin
| Type | Name |
|---|---|
| const std::size_t | id_ |
| std::string | name_ |
| const phonebook * | phonebook_ |
| std::shared_ptr< spdlog::logger > | plugin_logger_ |
| const std::shared_ptr< record_logger > | record_logger_ |
Detailed Description
Reliable framed-message transport for networked switchboard topics.
The backend owns a joinable I/O thread and serializes concurrent writers so topic frames cannot interleave on the shared byte stream.
Public Attributes Documentation
variable client
bool ILLIXR::tcp_network_backend::client;
Public Functions Documentation
function is_topic_networked
virtual bool ILLIXR::tcp_network_backend::is_topic_networked (
std::string topic_name
) override
Used to query if a topic is networked.
The backend should coordinate with the other endpoints to determine if a topic is networked. There are two cases where this should return true: * topic_create has been called with the same topic_name * topic_create has not been called with the same topic_name, but the topic is networked by another endpoint The backend implementation should coordinate with the other endpoints to determine if a topic is networked.
Parameters:
topic_nameThe name of the topic.
Implements ILLIXR::network::network_backend::is_topic_networked
function read_loop
void ILLIXR::tcp_network_backend::read_loop (
network::TCPSocket * socket
)
function start_client
virtual void ILLIXR::tcp_network_backend::start_client () override
Implements ILLIXR::network::network_backend::start_client
function start_server
virtual void ILLIXR::tcp_network_backend::start_server () override
Implements ILLIXR::network::network_backend::start_server
function stop
virtual void ILLIXR::tcp_network_backend::stop () override
Interrupt blocking socket I/O, join the worker, and release the peer.
Implements ILLIXR::plugin::stop
function tcp_network_backend
explicit ILLIXR::tcp_network_backend::tcp_network_backend (
const std::string & name_,
phonebook * pb_
)
function topic_create
virtual void ILLIXR::tcp_network_backend::topic_create (
std::string topic_name,
network::topic_config & config
) override
Called when a topic is created.
The backend must maintain a list of networked topics. This adds a topic to that list.
Parameters:
topic_nameThe name of the topic.configThe configuration of the topic.
Implements ILLIXR::network::network_backend::topic_create
function topic_receive
void ILLIXR::tcp_network_backend::topic_receive (
const std::string & topic_name,
std::vector< char > & message
)
function topic_send
virtual void ILLIXR::tcp_network_backend::topic_send (
std::string topic_name,
std::string && message
) override
Called when a message is requested to be sent on a topic by a plugin.
Parameters:
topic_nameThe name of the topic.messageThe message to send.
Implements ILLIXR::network::network_backend::topic_send
function transport_method
inline virtual network::topic_config::TransportMethod ILLIXR::tcp_network_backend::transport_method () override const
Implements ILLIXR::network::network_backend::transport_method
function ~tcp_network_backend
ILLIXR::tcp_network_backend::~tcp_network_backend () override
Stop and join the I/O thread before releasing its peer socket.
The documentation for this class was generated from the following file /home/friedel/devel/ILLIXR/illixr_release/ILLIXR/plugins/tcp_network_backend/plugin.hpp