Skip to content

Commit 5c3508f

Browse files
ficetoficeto
ficeto
authored and
ficeto
committed
add method to check for clients without referencing them
1 parent 894f99b commit 5c3508f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiServer.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ void WiFiServer::begin()
7575

7676
extern "C" uint32_t esp_micros_at_task_start();
7777

78+
bool WiFiServer::hasClient(){
79+
if (_unclaimed) return true;
80+
return false;
81+
}
82+
7883
WiFiClient WiFiServer::available(byte* status)
7984
{
8085
static uint32_t lastPollTime = 0;

hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/WiFiServer.h

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class WiFiServer : public Server {
4444
public:
4545
WiFiServer(uint16_t port);
4646
WiFiClient available(uint8_t* status = NULL);
47+
bool hasClient();
4748
void begin();
4849
virtual size_t write(uint8_t);
4950
virtual size_t write(const uint8_t *buf, size_t size);

0 commit comments

Comments
 (0)