mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Add support WiFiClientSecure TCP KeepAlive (#8940)
* Add support WiFiClientSecure TCP KeepAlive * Make TCP keepalive and related functions virtual. * Make TCP keepalive and related functions override. Fixes #8939
This commit is contained in:
parent
57fa6cdc92
commit
e05656bd78
@ -107,12 +107,12 @@ public:
|
||||
static void stopAll();
|
||||
static void stopAllExcept(WiFiClient * c);
|
||||
|
||||
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);
|
||||
bool isKeepAliveEnabled () const;
|
||||
uint16_t getKeepAliveIdle () const;
|
||||
uint16_t getKeepAliveInterval () const;
|
||||
uint8_t getKeepAliveCount () const;
|
||||
void disableKeepAlive () { keepAlive(0, 0, 0); }
|
||||
virtual 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);
|
||||
virtual bool isKeepAliveEnabled () const;
|
||||
virtual uint16_t getKeepAliveIdle () const;
|
||||
virtual uint16_t getKeepAliveInterval () const;
|
||||
virtual uint8_t getKeepAliveCount () const;
|
||||
virtual void disableKeepAlive () { keepAlive(0, 0, 0); }
|
||||
|
||||
// default NoDelay=False (Nagle=True=!NoDelay)
|
||||
// Nagle is for shortly delaying outgoing data, to send less/bigger packets
|
||||
|
@ -357,6 +357,21 @@ class WiFiClientSecure : public WiFiClient {
|
||||
|
||||
// consume bytes after use (see peekBuffer)
|
||||
virtual void peekConsume (size_t consume) override { return _ctx->peekConsume(consume); }
|
||||
|
||||
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) override
|
||||
{
|
||||
_ctx->keepAlive(idle_sec, intv_sec, count);
|
||||
}
|
||||
|
||||
bool isKeepAliveEnabled() const override { return _ctx->isKeepAliveEnabled(); };
|
||||
|
||||
uint16_t getKeepAliveIdle() const override { return _ctx->getKeepAliveIdle(); };
|
||||
|
||||
uint16_t getKeepAliveInterval() const override { return _ctx->getKeepAliveInterval(); };
|
||||
|
||||
uint8_t getKeepAliveCount() const override { return _ctx->getKeepAliveCount(); };
|
||||
|
||||
void disableKeepAlive() override { _ctx->disableKeepAlive(); };
|
||||
|
||||
private:
|
||||
std::shared_ptr<WiFiClientSecureCtx> _ctx;
|
||||
|
Loading…
x
Reference in New Issue
Block a user