Reset timeout on websocket send and publishes

This commit is contained in:
Alex Hultman
2019-10-08 22:59:22 +02:00
parent f58a9e1e0d
commit cbb46b494f
2 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -47,10 +47,11 @@ struct WebSocketContextData {
/* Each websocket context has a topic tree for pub/sub */
TopicTree topicTree;
WebSocketContextData() : topicTree([](Subscriber *s, std::string_view data) -> int {
WebSocketContextData() : topicTree([this](Subscriber *s, std::string_view data) -> int {
/* We rely on writing to regular asyncSockets */
auto *asyncSocket = (AsyncSocket<SSL> *) s->user;
asyncSocket->timeout(this->idleTimeout);
asyncSocket->write(data.data(), data.length());
/* Reserved, unused */