diff --git a/src/AsyncWebSocket.cpp b/src/AsyncWebSocket.cpp index f76f2fc96..478ea7814 100644 --- a/src/AsyncWebSocket.cpp +++ b/src/AsyncWebSocket.cpp @@ -263,6 +263,8 @@ class AsyncWebSocketControl { uint8_t opcode(){ return _opcode; } uint8_t len(){ return _len + 2; } size_t send(AsyncClient *client){ + if (_finished) + return 0; _finished = true; return webSocketSendFrame(client, true, _opcode & 0x0F, _mask, _data, _len); } diff --git a/src/AsyncWebSocket.h b/src/AsyncWebSocket.h index 5b03aceb9..4e60384b4 100644 --- a/src/AsyncWebSocket.h +++ b/src/AsyncWebSocket.h @@ -166,8 +166,9 @@ class AsyncWebSocketClient { uint8_t _pstate; AwsFrameInfo _pinfo; - +public: uint32_t _lastMessageTime; +private: uint32_t _keepAlivePeriod; void _queueMessage(AsyncWebSocketMessage *dataMessage);