forked from espressif/arduino-esp32
Add WiFiServer hasClient and WiFiTelnetToSerial example (#394)
WiFiTelnetToSerial is also a test for hasClient().
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
class WiFiServer : public Server {
|
||||
private:
|
||||
int sockfd;
|
||||
int _accepted_sockfd = -1;
|
||||
uint16_t _port;
|
||||
uint8_t _max_clients;
|
||||
bool _listening;
|
||||
@ -34,13 +35,14 @@ class WiFiServer : public Server {
|
||||
public:
|
||||
void listenOnLocalhost(){}
|
||||
|
||||
WiFiServer(uint16_t port=80, uint8_t max_clients=4):sockfd(-1),_port(port),_max_clients(max_clients),_listening(false){}
|
||||
WiFiServer(uint16_t port=80, uint8_t max_clients=4):sockfd(-1),_accepted_sockfd(-1),_port(port),_max_clients(max_clients),_listening(false),_noDelay(false){}
|
||||
~WiFiServer(){ end();}
|
||||
WiFiClient available();
|
||||
WiFiClient accept(){return available();}
|
||||
void begin();
|
||||
void setNoDelay(bool nodelay);
|
||||
bool getNoDelay();
|
||||
bool hasClient();
|
||||
size_t write(const uint8_t *data, size_t len);
|
||||
size_t write(uint8_t data){
|
||||
return write(&data, 1);
|
||||
|
Reference in New Issue
Block a user