24 #include <string_view>
48 TcpClient(
const std::string& host, uint16_t port);
49 TcpClient(
const std::string& host, uint16_t port, std::shared_ptr<boost::asio::io_context> external_ioc);
50 explicit TcpClient(std::shared_ptr<interface::Channel> channel);
62 std::future<
bool> start() override;
64 void send(std::string_view data) override;
65 void send_line(std::string_view line) override;
66 bool is_connected() const override;
76 TcpClient& set_retry_interval(std::chrono::milliseconds interval);
77 TcpClient& set_max_retries(
int max_retries);
78 TcpClient& set_connection_timeout(std::chrono::milliseconds timeout);
79 TcpClient& set_manage_external_context(
bool manage);
83 const
Impl* get_impl()
const {
return impl_.get(); }
84 Impl* get_impl() {
return impl_.get(); }
85 std::unique_ptr<Impl> impl_;
Common interface for 1:1 point-to-point communication (e.g., TcpClient, Serial, Udp)
std::function< void(const ErrorContext &)> ErrorHandler
std::function< void(const MessageContext &)> MessageHandler
std::function< void(const ConnectionContext &)> ConnectionHandler
Modernized TCP Client Wrapper.
TcpClient(TcpClient &&) noexcept
wrapper::TcpClient TcpClient