Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiFiServer - don't inherit from Print and Server #8930

Merged
merged 4 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_ */