Skip to content

Commit a337bdd

Browse files
authored
Merge pull request #1 from mobizt/mobizt-patch-1
Add support WiFiClientSecure TCP KeepAlive
2 parents 57fa6cd + 812753c commit a337bdd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,21 @@ class WiFiClientSecure : public WiFiClient {
357357

358358
// consume bytes after use (see peekBuffer)
359359
virtual void peekConsume (size_t consume) override { return _ctx->peekConsume(consume); }
360+
361+
void keepAlive(uint16_t idle_sec = TCP_DEFAULT_KEEPALIVE_IDLE_SEC, uint16_t intv_sec = TCP_DEFAULT_KEEPALIVE_INTERVAL_SEC, uint8_t count = TCP_DEFAULT_KEEPALIVE_COUNT)
362+
{
363+
_ctx->keepAlive(idle_sec, intv_sec, count);
364+
}
365+
366+
bool isKeepAliveEnabled() const { return _ctx->isKeepAliveEnabled(); };
367+
368+
uint16_t getKeepAliveIdle() const { return _ctx->getKeepAliveIdle(); };
369+
370+
uint16_t getKeepAliveInterval() const { return _ctx->getKeepAliveInterval(); };
371+
372+
uint8_t getKeepAliveCount() const { return _ctx->getKeepAliveCount(); };
373+
374+
void disableKeepAlive() { _ctx->disableKeepAlive(); };
360375

361376
private:
362377
std::shared_ptr<WiFiClientSecureCtx> _ctx;

0 commit comments

Comments
 (0)