Skip to content

Commit

Permalink
WiFiServer - don't inherit from Print and Server (#8930)
Browse files Browse the repository at this point in the history
because print-to-all-clients is not implemented

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 23, 2024
1 parent e73af48 commit 39043b8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
6 changes: 0 additions & 6 deletions libraries/WiFi/src/WiFiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ int WiFiServer::setTimeout(uint32_t seconds){
return setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval));
}

size_t WiFiServer::write(const uint8_t *data, size_t len){
return 0;
}

void WiFiServer::stopAll(){}

WiFiClient WiFiServer::available(){
return accept();
}
Expand Down
8 changes: 1 addition & 7 deletions libraries/WiFi/src/WiFiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "WiFiClient.h"
#include "IPAddress.h"

class WiFiServer : public Server {
class WiFiServer {
private:
int sockfd;
int _accepted_sockfd = -1;
Expand All @@ -51,18 +51,12 @@ class WiFiServer : public Server {
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);
}
using Print::write;

void end();
void close();
void stop();
operator bool(){return _listening;}
int setTimeout(uint32_t seconds);
void stopAll();
};

#endif /* _WIFISERVER_H_ */

0 comments on commit 39043b8

Please sign in to comment.