Skip to content

Commit eb15ce1

Browse files
committed
added comparison operator to wifiServer class
1 parent 60a2ced commit eb15ce1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

libraries/WiFiS3/src/WiFiServer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,9 @@ void WiFiServer::end() {
8282
modem.write(string(PROMPT(_SERVEREND)),res, "%s%d\r\n" , CMD_WRITE(_SERVEREND), _sock);
8383
_sock = -1;
8484
}
85+
}
86+
87+
bool WiFiServer::operator==(const WiFiServer& whs)
88+
{
89+
return _sock == whs._sock;
8590
}

libraries/WiFiS3/src/WiFiServer.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ class WiFiServer : public Server {
4242
virtual size_t write(uint8_t);
4343
virtual size_t write(const uint8_t *buf, size_t size);
4444
void end();
45-
45+
virtual bool operator==(const WiFiServer&);
46+
virtual bool operator!=(const WiFiServer& whs)
47+
{
48+
return !this->operator==(whs);
49+
};
4650

4751
using Print::write;
4852

0 commit comments

Comments
 (0)