aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edioutput
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2024-12-04 08:41:03 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2024-12-04 08:41:03 +0100
commit30a100d4fbc17972d71f75695441bbedeee076ef (patch)
tree5ef9d2bafe676ecc96ba470757a396f3045f4e0f /lib/edioutput
parent0251f975400ad019374283cdf79fbdc4dd1d350f (diff)
downloaddabmux-30a100d4fbc17972d71f75695441bbedeee076ef.tar.gz
dabmux-30a100d4fbc17972d71f75695441bbedeee076ef.tar.bz2
dabmux-30a100d4fbc17972d71f75695441bbedeee076ef.zip
common: Update Socketnext
Diffstat (limited to 'lib/edioutput')
-rw-r--r--lib/edioutput/Transport.cpp10
-rw-r--r--lib/edioutput/Transport.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/edioutput/Transport.cpp b/lib/edioutput/Transport.cpp
index 8ebb9fc..4979e93 100644
--- a/lib/edioutput/Transport.cpp
+++ b/lib/edioutput/Transport.cpp
@@ -193,7 +193,15 @@ void Sender::write(const AFPacket& af_packet)
tcp_dispatchers.at(tcp_dest.get())->write(af_packet);
}
else if (auto tcp_dest = dynamic_pointer_cast<edi::tcp_client_t>(dest)) {
- tcp_senders.at(tcp_dest.get())->sendall(af_packet);
+ const auto error_stats = tcp_senders.at(tcp_dest.get())->sendall(af_packet);
+
+ if (m_conf.verbose and error_stats.has_seen_new_errors) {
+ fprintf(stderr, "TCP output %s:%d has %zu reconnects: most recent error: %s\n",
+ tcp_dest->dest_addr.c_str(),
+ tcp_dest->dest_port,
+ error_stats.num_reconnects,
+ error_stats.last_error.c_str());
+ }
}
else {
throw logic_error("EDI destination not implemented");
diff --git a/lib/edioutput/Transport.h b/lib/edioutput/Transport.h
index 6a3f229..c62545c 100644
--- a/lib/edioutput/Transport.h
+++ b/lib/edioutput/Transport.h
@@ -31,11 +31,9 @@
#include "AFPacket.h"
#include "PFT.h"
#include "Socket.h"
-#include <vector>
#include <chrono>
#include <map>
#include <unordered_map>
-#include <stdexcept>
#include <fstream>
#include <cstdint>
#include <thread>