Skip to content

Revert TCP connect and send delay fix (#6213) #6440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions libraries/ESP8266WiFi/src/include/ClientContext.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
/*
ClientContext.h - TCP connection handling on top of lwIP

Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Expand Down Expand Up @@ -130,11 +126,8 @@ class ClientContext
}
_connect_pending = 1;
_op_start_time = millis();
// Following delay will be interrupted by connect callback
for (decltype(_timeout_ms) i = 0; _connect_pending && i < _timeout_ms; i++) {
// Give scheduled functions a chance to run (e.g. Ethernet uses recurrent)
delay(1);
}
// This delay will be interrupted by esp_schedule in the connect callback
delay(_timeout_ms);
_connect_pending = 0;
if (!_pcb) {
DEBUGV(":cabrt\r\n");
Expand Down Expand Up @@ -459,11 +452,8 @@ class ClientContext
}

_send_waiting = true;
// Following delay will be interrupted by on next received ack
for (decltype(_timeout_ms) i = 0; _send_waiting && i < _timeout_ms; i++) {
// Give scheduled functions a chance to run (e.g. Ethernet uses recurrent)
delay(1);
}
// This delay will be interrupted by esp_schedule on next received ack
delay(_timeout_ms);
} while(true);
_send_waiting = false;

Expand Down Expand Up @@ -609,7 +599,6 @@ class ClientContext
(void) pcb;
assert(pcb == _pcb);
assert(_connect_pending);
_connect_pending = 0;
esp_schedule();
return ERR_OK;
}
Expand Down