* ESP8266WebServer - drop current HC_WAIT_READ connection sooner when another has data Safari sometimes opens two connections when loading a page and only sends a request over the second one, resulting in a 5 second wait (HTTP_MAX_DATA_WAIT) before the request is processed. This commit drops the current connection after 30ms (HTTP_MAX_DATA_AVAILABLE_WAIT) when there is a new connection with data available or the buffer of pending TCP clients is full (currently 5).
2.6 KiB
- orphan
Server Class
Methods documented for the Server Class in Arduino
Methods and properties described further down are specific to ESP8266. They are not covered in Arduino WiFi library documentation. Before they are fully documented please refer to information below.
write (write to all clients) not supported
Please note that the write
method on the
WiFiServer
object is not implemented and returns failure
always. Use the returned WiFiClient
object from the
WiFiServer::available()
method to communicate with
individual clients. If you need to send the exact same packets to a
series of clients, your application must maintain a list of connected
clients and iterate over them manually.
setNoDelay
(nodelay) setNoDelay
With nodelay
set to true
, this function
will to disable Nagle
algorithm.
This algorithm is intended to reduce TCP/IP traffic of small packets sent over the network by combining a number of small outgoing messages, and sending them all at once. The downside of such approach is effectively delaying individual messages until a big enough packet is assembled.
Example:
.begin();
server.setNoDelay(true); server
By default, nodelay
value will depends on global
WiFiClient::getDefaultNoDelay()
(currently false by
default).
However, a call to wiFiServer.setNoDelay()
will override
NoDelay
for all new WiFiClient
provided by the
calling instance (wiFiServer
).
Other Function Calls
bool hasClient ()
size_t hasClientData ()
bool hasMaxPendingClients ()
bool getNoDelay ()
virtual size_t write (const uint8_t *buf, size_t size)
uint8_t status ()
void close ()
void stop ()
Documentation for the above functions is not yet prepared.
For code samples please refer to separate section with examples dedicated specifically to the Server Class.