25 #ifndef GOBY_UTIL_LINEBASEDCOMMS_TCP_SERVER_H
26 #define GOBY_UTIL_LINEBASEDCOMMS_TCP_SERVER_H
56 return local_endpoint_.addr() +
":" +
std::to_string(local_endpoint_.port());
61 return remote_endpoints_;
65 void do_subscribe()
override;
66 void do_start()
override;
67 void do_close()
override;
76 std::atomic<bool> tcp_alive_{
false};
77 std::unique_ptr<std::thread> tcp_thread_;
80 goby::middleware::protobuf::TCPServerEvent event_;
82 goby::middleware::protobuf::TCPEndPoint local_endpoint_;
83 std::set<middleware::protobuf::TCPEndPoint> remote_endpoints_;
basic interface class for all the derived serial (and networking mimics) line-based nodes (serial,...
std::string delimiter() const
provides a basic TCP server for line by line text based communications to a one or more remote TCP cl...
const std::set< middleware::protobuf::TCPEndPoint > & remote_endpoints()
TCPServer(unsigned port, const std::string &delimiter="\r\n")
create a TCP server
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.