From 9f764ac414025f62684a04f4a96edfb26bb67554 Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sun, 11 May 2025 18:41:20 +0200 Subject: [PATCH] TCP bridge more logging (#23410) --- .../tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino index 0d5545769..ee1df80a7 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino @@ -63,7 +63,16 @@ void TCPLoop(void) if ((server_tcp) && (server_tcp->hasClient())) { WiFiClient new_client = server_tcp->available(); - AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TCP "Got connection from %s"), new_client.remoteIP().toString().c_str()); + // count already connected ports + uint32_t connected = 0; + for (uint32_t i=0; i= nitems(client_tcp)) { i = client_next++ % nitems(client_tcp); WiFiClient &client = client_tcp[i]; - client.stop(); + if (client.connected()) { + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_TCP "Replacing connection in slot %i, closing connection from %s"), i, client.remoteIP().toString().c_str()); + client.stop(); + } client = new_client; } }