EthernetServer class.
Definition at line 42 of file EthernetServer.h.
#include <EthernetServer.h>
◆ EthernetServer()
EthernetServer::EthernetServer |
( |
uint16_t |
port, |
|
|
uint16_t |
max_clients = ETHERNETSERVER_MAX_CLIENTS |
|
) |
| |
EthernetServer constructor.
- Parameters
-
port | number for the socket addresses. |
max_clients | The maximum number allowed for connected clients. |
◆ available()
Get the new connected client.
- Returns
- a EthernetClient object; if no new client has connected, this object will evaluate to false.
◆ begin() [1/2]
virtual void EthernetServer::begin |
( |
| ) |
|
|
virtual |
Listen for inbound connection request.
◆ begin() [2/2]
Listen on the specified ip for inbound connection request.
- Parameters
-
addr | IP address to bind to. |
◆ hasClient()
bool EthernetServer::hasClient |
( |
| ) |
|
Verifies if a new client has connected.
- Returns
true
if a new client has connected, else false
.
◆ write() [1/4]
size_t EthernetServer::write |
( |
const char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
Write at most 'size' characters to all clients.
- Parameters
-
buffer | to read from. |
size | of the buffer. |
- Returns
- 0 if FAILURE else the number of characters sent.
◆ write() [2/4]
size_t EthernetServer::write |
( |
const char * |
str | ) |
|
Write a null-terminated string to all clients.
- Parameters
-
- Returns
- 0 if FAILURE else number of characters sent.
◆ write() [3/4]
virtual size_t EthernetServer::write |
( |
const uint8_t * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Write at most 'size' bytes to all clients.
- Parameters
-
buffer | to read from. |
size | of the buffer. |
- Returns
- 0 if FAILURE else number of bytes sent.
◆ write() [4/4]
virtual size_t EthernetServer::write |
( |
uint8_t |
b | ) |
|
|
virtual |
Write a byte to all clients.
- Parameters
-
- Returns
- 0 if FAILURE or 1 if SUCCESS.
The documentation for this class was generated from the following file: