1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00
esp8266/doc/esp8266wifi/server-class.md
Krzysztof d6e38f0abd ESP8266WiFi library documentation (#2388)
* New section with ESP8266WiFi library documentation

* ESP8266WiFi library documentation

1. Introduction - example, diagnostic, doxygen
2. Station - examples, new doc
3. Soft Access Point - examples, new doc
4. Scan - examples, new doc
5. Client - examples, ref. Arduino, setNoDelay, list of functions
6. Client Secure - examples, loadCertificate, setCertificate, list of
functions
7. Server- examples, ref. Arduino, setNoDelay, list of functions
8. UDP - examples, ref. Arduino, Multicast UDP
9. Generic - examples, onEvent, WiFiEventHandler, persistent, mode, list
of functions

* Fixed numbered list
2016-08-25 11:01:05 +08:00

54 lines
1.8 KiB
Markdown

---
title: ESP8266WiFi Server Class
---
[ESP8266WiFi Library :back:](readme.md#server)
## Server Class
Methods documented for the [Server Class](https://www.arduino.cc/en/Reference/WiFiServerConstructor) in [Arduino](https://github.com/arduino/Arduino)
1. [WiFiServer()](https://www.arduino.cc/en/Reference/WiFiServer)
2. [begin()](https://www.arduino.cc/en/Reference/WiFiServerBegin)
3. [available()](https://www.arduino.cc/en/Reference/WiFiServerAvailable)
4. [write()](https://www.arduino.cc/en/Reference/WiFiServerWrite)
5. [print()](https://www.arduino.cc/en/Reference/WiFiServerPrint)
6. [println()](https://www.arduino.cc/en/Reference/WiFiServerPrintln)
Methods and properties described further down are specific to ESP8266. They are not covered in [Arduino WiFi library](https://www.arduino.cc/en/Reference/WiFi) documentation. Before they are fully documented please refer to information below.
### setNoDelay
```cpp
setNoDelay(nodelay)
```
With `nodelay` set to `true`, this function will to disable [Nagle algorithm](https://en.wikipedia.org/wiki/Nagle%27s_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:*
```cpp
server.begin();
server.setNoDelay(true);
```
### Other Function Calls
```cpp
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 :arrow_right:](server-examples.md) dedicated specifically to the Server Class.