Skip to content

WiFiS3 WiFiServer operator bool #140

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

Merged
merged 1 commit into from
Dec 13, 2023
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
7 changes: 6 additions & 1 deletion libraries/WiFiS3/src/WiFiServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ void WiFiServer::end() {
}
}

WiFiServer::operator bool()
{
return (_sock != -1);
}

bool WiFiServer::operator==(const WiFiServer& whs)
{
return _sock == whs._sock;
}
}
1 change: 1 addition & 0 deletions libraries/WiFiS3/src/WiFiServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class WiFiServer : public Server {
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
void end();
explicit operator bool();
virtual bool operator==(const WiFiServer&);
virtual bool operator!=(const WiFiServer& whs)
{
Expand Down