25 #ifndef GOBY_UTIL_LINEBASEDCOMMS_TCP_CLIENT_H
26 #define GOBY_UTIL_LINEBASEDCOMMS_TCP_CLIENT_H
53 int retry_interval = 10);
59 return local_endpoint_.addr() +
":" +
std::to_string(local_endpoint_.port());
64 return remote_endpoint_.addr() +
":" +
std::to_string(remote_endpoint_.port());
68 void do_subscribe()
override;
69 void do_start()
override;
70 void do_close()
override;
82 std::atomic<bool> tcp_alive_{
false};
83 std::unique_ptr<std::thread> tcp_thread_;
85 goby::middleware::protobuf::TCPClientEvent event_;
87 goby::middleware::protobuf::TCPEndPoint remote_endpoint_;
88 goby::middleware::protobuf::TCPEndPoint local_endpoint_;
Reads/Writes strings from/to a TCP connection using a line-based (typically ASCII) protocol with a de...
basic interface class for all the derived serial (and networking mimics) line-based nodes (serial,...
std::string delimiter() const
provides a basic TCP client for line by line text based communications to a remote TCP server
TCPClient(std::string server, unsigned port, const std::string &delimiter="\r\n", int retry_interval=10)
create a TCPClient
std::string remote_endpoint() override
string representation of the remote endpoint, (e.g. 192.168.1.106:50000)
std::string local_endpoint() override
string representation of the local endpoint (e.g. 192.168.1.105:54230)
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
constexpr goby::middleware::Group linebasedcomms_in
constexpr goby::middleware::Group linebasedcomms_out
The global namespace for the Goby project.