44 #if (VTD_API_VERSION_EPOCH == 0)
47 #include <VtdToolkit/scpIcd.h>
62 virtual std::string to_scp()
const = 0;
75 virtual ~
ScpError() noexcept =
default;
83 using TcpTransceiver::TcpTransceiver;
86 void send(
const ScpMessage& msg) { write(msg.to_scp()); }
87 void send(
const std::string& msg) { write(msg.c_str()); }
88 void send(
const char* msg) { write(msg); }
92 return this->
tcp_available_data() >=
static_cast<std::streamsize
>(
sizeof(SCP_MSG_HDR_t));
95 std::string receive();
99 {
"connection_endpoint", t.tcp_endpoint()},
101 {
"num_errors", t.num_errors_},
102 {
"num_messages_sent", t.num_sent_},
103 {
"num_messages_received", t.num_received_},
108 void write(
const std::string& msg) { write(msg.c_str()); }
109 void write(
const char* msg);
112 uint64_t num_errors_{0};
113 uint64_t num_sent_{0};
114 uint64_t num_received_{0};
119 using TcpTransceiverFactory::TcpTransceiverFactory;
123 cloe::Logger factory_logger()
const override {
return scp_logger(); }
124 const char* instance_name()
const override {
return "ScpTransceiver"; }
Definition: tcp_transceiver.hpp:149
Definition: tcp_transceiver.hpp:59
bool tcp_is_ok() const
Definition: tcp_transceiver.hpp:92
std::streamsize tcp_available_data() const
Definition: tcp_transceiver.hpp:112
Definition: scp_transceiver.hpp:72
Definition: scp_transceiver.hpp:59
Definition: scp_transceiver.hpp:117
Definition: scp_transceiver.hpp:81