1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00
esp8266/doc/esp8266wifi/server-class.rst
david gauchard 83a8076db8 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
2018-09-25 10:47:27 -03:00

2.1 KiB

orphan

Server Class

Methods documented for the Server Class in Arduino

  1. WiFiServer()
  2. begin()
  3. available()
  4. write()
  5. print()
  6. println()

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.

setNoDelay

setNoDelay(nodelay)

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:

server.begin();
server.setNoDelay(true);

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 () 
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.