ESP8266MQTTClient icon indicating copy to clipboard operation
ESP8266MQTTClient copied to clipboard

Only read one websocket frame at a time

Open lhns opened this issue 5 years ago • 0 comments

This PR reworks the websocket read logic to read exactly one websocket frame from the tcp buffer for each loop iteration. This is done by first peeking at the tcp buffer to read the header to read the payload size. The previous implementation just read the whole buffer, decoded the first websocket frame and discarded the remaining buffer. This leads to problems when there are multiple websocket frames already in the buffer.

lhns avatar Jun 16 '20 21:06 lhns