mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-06 05:21:22 +03:00
add TCP_NODELAY control
This commit is contained in:
parent
669609f3d7
commit
f2f1fad298
@ -73,6 +73,17 @@ void WiFiServer::begin()
|
|||||||
tcp_arg(listen_pcb, (void*) this);
|
tcp_arg(listen_pcb, (void*) this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WiFiServer::setNoDelay(bool nodelay){
|
||||||
|
if(!_pcb) return;
|
||||||
|
if(nodelay) tcp_nagle_disable(_pcb);
|
||||||
|
else tcp_nagle_enable(_pcb);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool WiFiServer::getNoDelay(){
|
||||||
|
if(!_pcb) return false;
|
||||||
|
return tcp_nagle_disabled(_pcb);
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" uint32_t esp_micros_at_task_start();
|
extern "C" uint32_t esp_micros_at_task_start();
|
||||||
|
|
||||||
bool WiFiServer::hasClient(){
|
bool WiFiServer::hasClient(){
|
||||||
|
@ -46,6 +46,8 @@ public:
|
|||||||
WiFiClient available(uint8_t* status = NULL);
|
WiFiClient available(uint8_t* status = NULL);
|
||||||
bool hasClient();
|
bool hasClient();
|
||||||
void begin();
|
void begin();
|
||||||
|
void setNoDelay(bool nodelay);
|
||||||
|
bool getNoDelay();
|
||||||
virtual size_t write(uint8_t);
|
virtual size_t write(uint8_t);
|
||||||
virtual size_t write(const uint8_t *buf, size_t size);
|
virtual size_t write(const uint8_t *buf, size_t size);
|
||||||
uint8_t status();
|
uint8_t status();
|
||||||
|
@ -98,7 +98,18 @@ class ClientContext {
|
|||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setNoDelay(bool nodelay){
|
||||||
|
if(!_pcb) return;
|
||||||
|
if(nodelay) tcp_nagle_disable(_pcb);
|
||||||
|
else tcp_nagle_enable(_pcb);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool getNoDelay(){
|
||||||
|
if(!_pcb) return false;
|
||||||
|
return tcp_nagle_disabled(_pcb);
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t getRemoteAddress() {
|
uint32_t getRemoteAddress() {
|
||||||
if(!_pcb) return 0;
|
if(!_pcb) return 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user