|
unilink
0.4.3
A simple C++ library for unified async communication
|
Modernized TCP Client Wrapper. More...
#include <tcp_client.hpp>
Classes | |
| struct | Impl |
Public Member Functions | |
| TcpClient (const std::string &host, uint16_t port) | |
| TcpClient (const std::string &host, uint16_t port, std::shared_ptr< boost::asio::io_context > external_ioc) | |
| TcpClient (std::shared_ptr< interface::Channel > channel) | |
| ~TcpClient () override | |
| TcpClient (TcpClient &&) noexcept | |
| TcpClient & | operator= (TcpClient &&) noexcept |
| TcpClient (const TcpClient &)=delete | |
| TcpClient & | operator= (const TcpClient &)=delete |
| std::future< bool > | start () override |
| void | stop () override |
| void | send (std::string_view data) override |
| void | send_line (std::string_view line) override |
| bool | is_connected () const override |
| ChannelInterface & | on_data (MessageHandler handler) override |
| ChannelInterface & | on_connect (ConnectionHandler handler) override |
| ChannelInterface & | on_disconnect (ConnectionHandler handler) override |
| ChannelInterface & | on_error (ErrorHandler handler) override |
| ChannelInterface & | auto_manage (bool manage=true) override |
| TcpClient & | set_retry_interval (std::chrono::milliseconds interval) |
| TcpClient & | set_max_retries (int max_retries) |
| TcpClient & | set_connection_timeout (std::chrono::milliseconds timeout) |
| TcpClient & | set_manage_external_context (bool manage) |
Public Member Functions inherited from unilink::wrapper::ChannelInterface | |
| virtual | ~ChannelInterface ()=default |
Additional Inherited Members | |
Public Types inherited from unilink::wrapper::ChannelInterface | |
| using | MessageHandler = std::function< void(const MessageContext &)> |
| using | ConnectionHandler = std::function< void(const ConnectionContext &)> |
| using | ErrorHandler = std::function< void(const ErrorContext &)> |
Modernized TCP Client Wrapper.
Definition at line 46 of file tcp_client.hpp.
| unilink::wrapper::TcpClient::TcpClient | ( | const std::string & | host, |
| uint16_t | port | ||
| ) |
Definition at line 229 of file tcp_client.cc.
| unilink::wrapper::TcpClient::TcpClient | ( | const std::string & | host, |
| uint16_t | port, | ||
| std::shared_ptr< boost::asio::io_context > | external_ioc | ||
| ) |
Definition at line 230 of file tcp_client.cc.
|
explicit |
Definition at line 232 of file tcp_client.cc.
|
overridedefault |
|
defaultnoexcept |
|
delete |
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 261 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 242 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 248 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 244 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 252 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 256 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 240 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 241 of file tcp_client.cc.
| TcpClient & unilink::wrapper::TcpClient::set_connection_timeout | ( | std::chrono::milliseconds | timeout | ) |
Definition at line 280 of file tcp_client.cc.
| TcpClient & unilink::wrapper::TcpClient::set_manage_external_context | ( | bool | manage | ) |
Definition at line 284 of file tcp_client.cc.
| TcpClient & unilink::wrapper::TcpClient::set_max_retries | ( | int | max_retries | ) |
Definition at line 276 of file tcp_client.cc.
| TcpClient & unilink::wrapper::TcpClient::set_retry_interval | ( | std::chrono::milliseconds | interval | ) |
Definition at line 267 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 238 of file tcp_client.cc.
|
overridevirtual |
Implements unilink::wrapper::ChannelInterface.
Definition at line 239 of file tcp_client.cc.