Changed WebSocket connection timeout

pull/123/head
Hieromon Ikasamo 6 years ago
parent a94f64accf
commit 844103f449
  1. 3
      src/AutoConnectUpdate.cpp

@ -216,7 +216,7 @@ void AutoConnectUpdate::handleUpdate(void) {
if (_status == UPDATE_START) { if (_status == UPDATE_START) {
unsigned long tm = millis(); unsigned long tm = millis();
while (!_wsConnected) { while (!_wsConnected) {
if (millis() - tm > 30 * 1000) { if (millis() - tm > AUTOCONNECT_TIMEOUT) {
AC_DBG("WebSocket client connection timeout, update ignored\n"); AC_DBG("WebSocket client connection timeout, update ignored\n");
break; break;
} }
@ -254,6 +254,7 @@ AC_UPDATESTATUS_t AutoConnectUpdate::update(void) {
_WiFiClient.reset(new WiFiClient); _WiFiClient.reset(new WiFiClient);
_period = millis(); _period = millis();
} }
_ws->loop();
t_httpUpdate_return ret = HTTPUpdateClass::update(*_WiFiClient, host, port, uriBin); t_httpUpdate_return ret = HTTPUpdateClass::update(*_WiFiClient, host, port, uriBin);
switch (ret) { switch (ret) {
case HTTP_UPDATE_FAILED: case HTTP_UPDATE_FAILED:

Loading…
Cancel
Save