mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-10 04:22:05 +03:00
ClientContext (tcp) updates (#5089)
* +sync, get/set default nodelay, sync * default nodelay=1 * update flush() * fix return value * ClientContext: put things together * ClientContext: fix debugging messages * WiFiClient: move static members out of the class, add comments * remove circular dependency * parameter and return value for Client::flush&stop, flush timeout raised to 300ms * tcp flush: restart timer on ack receive * OTA protocol needs setNoDelay(true) * fix Ethernet with Client changes * 1 line unredable -> 5 lines readable code * doc * Update client-class.rst * Added details for getters
This commit is contained in:
@ -88,11 +88,16 @@ void WiFiServer::begin(uint16_t port) {
|
||||
}
|
||||
|
||||
void WiFiServer::setNoDelay(bool nodelay) {
|
||||
_noDelay = nodelay;
|
||||
_noDelay = nodelay? _ndTrue: _ndFalse;
|
||||
}
|
||||
|
||||
bool WiFiServer::getNoDelay() {
|
||||
return _noDelay;
|
||||
switch (_noDelay)
|
||||
{
|
||||
case _ndFalse: return false;
|
||||
case _ndTrue: return true;
|
||||
default: return WiFiClient::getDefaultNoDelay();
|
||||
}
|
||||
}
|
||||
|
||||
bool WiFiServer::hasClient() {
|
||||
@ -106,7 +111,7 @@ WiFiClient WiFiServer::available(byte* status) {
|
||||
if (_unclaimed) {
|
||||
WiFiClient result(_unclaimed);
|
||||
_unclaimed = _unclaimed->next();
|
||||
result.setNoDelay(_noDelay);
|
||||
result.setNoDelay(getNoDelay());
|
||||
DEBUGV("WS:av\r\n");
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user