mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
bug fix: ethernet cli dropping connection after each command
This commit is contained in:
parent
3c1a0941aa
commit
0ffe1c2cb9
1 changed files with 2 additions and 0 deletions
|
|
@ -102,6 +102,8 @@ static bool ethernet_handle_command(const char* command, char* reply) {
|
||||||
static void ethernet_check_client() {
|
static void ethernet_check_client() {
|
||||||
auto newClient = ethernet_server.available();
|
auto newClient = ethernet_server.available();
|
||||||
if (newClient) {
|
if (newClient) {
|
||||||
|
// Only replace if this is actually a different client
|
||||||
|
if (newClient == ethernet_client && ethernet_client.connected()) return;
|
||||||
if (ethernet_client) ethernet_client.stop();
|
if (ethernet_client) ethernet_client.stop();
|
||||||
ethernet_client = newClient;
|
ethernet_client = newClient;
|
||||||
IPAddress ip = ethernet_client.remoteIP();
|
IPAddress ip = ethernet_client.remoteIP();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue