mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
rename ClientContext::wait_until_sent() to wait_until_acked() (#7896)
* rename ClientContext::wait_until_sent() to wait_until_acked() While looking at #6348 and #6369, and after checking into lwIP sources, it appears that the tests in ClientContext::wait_until_sent() effectively wait for all acks on current output buffer. Comments are added. * host tests counterpart
This commit is contained in:
@ -308,7 +308,7 @@ bool WiFiClient::flush(unsigned int maxWaitMs)
|
|||||||
|
|
||||||
if (maxWaitMs == 0)
|
if (maxWaitMs == 0)
|
||||||
maxWaitMs = WIFICLIENT_MAX_FLUSH_WAIT_MS;
|
maxWaitMs = WIFICLIENT_MAX_FLUSH_WAIT_MS;
|
||||||
return _client->wait_until_sent(maxWaitMs);
|
return _client->wait_until_acked(maxWaitMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WiFiClient::stop(unsigned int maxWaitMs)
|
bool WiFiClient::stop(unsigned int maxWaitMs)
|
||||||
|
@ -315,7 +315,7 @@ public:
|
|||||||
_rx_buf_offset = 0;
|
_rx_buf_offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wait_until_sent(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
|
bool wait_until_acked(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
|
||||||
{
|
{
|
||||||
// https://github.com/esp8266/Arduino/pull/3967#pullrequestreview-83451496
|
// https://github.com/esp8266/Arduino/pull/3967#pullrequestreview-83451496
|
||||||
// option 1 done
|
// option 1 done
|
||||||
@ -352,6 +352,8 @@ public:
|
|||||||
delay(0); // from sys or os context
|
delay(0); // from sys or os context
|
||||||
|
|
||||||
if ((state() != ESTABLISHED) || (sndbuf == TCP_SND_BUF)) {
|
if ((state() != ESTABLISHED) || (sndbuf == TCP_SND_BUF)) {
|
||||||
|
// peer has closed or all bytes are sent and acked
|
||||||
|
// ((TCP_SND_BUF-sndbuf) is the amount of un-acked bytes)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -508,7 +510,7 @@ protected:
|
|||||||
} while(true);
|
} while(true);
|
||||||
|
|
||||||
if (_sync)
|
if (_sync)
|
||||||
wait_until_sent();
|
wait_until_acked();
|
||||||
|
|
||||||
return _written;
|
return _written;
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ public:
|
|||||||
mockverbose("TODO: ClientContext::discard_received()\n");
|
mockverbose("TODO: ClientContext::discard_received()\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wait_until_sent(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
|
bool wait_until_acked(int max_wait_ms = WIFICLIENT_MAX_FLUSH_WAIT_MS)
|
||||||
{
|
{
|
||||||
(void)max_wait_ms;
|
(void)max_wait_ms;
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user