Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: emelianov/modbus-esp8266
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: amdx/modbus-esp8266
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Feb 20, 2023

  1. Uncomment the explicit stop() method call to allow sockets cleanups

    This should allow w5xxx-based ethernet to clean up their sockets' states
    upon disconnection, preventing the server implementation to experience
    sockets starvation
    Marco Fagiolini authored and oxullo committed Feb 20, 2023
    Copy the full SHA
    8c7ebec View commit details
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/ModbusTCPTemplate.h
4 changes: 2 additions & 2 deletions src/ModbusTCPTemplate.h
Original file line number Diff line number Diff line change
@@ -437,7 +437,7 @@ void ModbusTCPTemplate<SERVER, CLIENT>::cleanupConnections() {
for (uint8_t i = 0; i < MODBUSIP_MAX_CLIENTS; i++) {
if (tcpclient[i] && !tcpclient[i]->connected()) {
//IPAddress ip = tcpclient[i]->remoteIP();
//tcpclient[i]->stop();
tcpclient[i]->stop();
delete tcpclient[i];
tcpclient[i] = nullptr;
if (cbDisconnect && cbEnabled)
@@ -546,7 +546,7 @@ bool ModbusTCPTemplate<SERVER, CLIENT>::disconnect(IPAddress ip) {
return false;
int8_t p = getSlave(ip);
if (p != -1) {
//tcpclient[p]->stop();
tcpclient[p]->stop();
delete tcpclient[p];
tcpclient[p] = nullptr;
return true;