Closed prenone closed 3 years ago
As with the last pull request I should have checked the issues before 🤣. This seems to be to related to #29. Sorry, these are some busy times.
Hi @prenone I think that this piece of code comes from times before I implemented ping/pong. Tomorrow I will run autobahn tests.
@prenone Unfortunately some tests failed. See attachment if you are curious.
What is the procedure to perform the Autobahn test? Is there a proper sketch I don't see?
Testsuite is located in dev branch You will need Docker to perform them.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have removed the timeout from the
WebSocket::_read()
function.This function gets called by
WebSocketClient::listen()
. I think the desired effect is to terminate the connection if nothing is received withinkTimeoutInterval
milliseconds. However I can't find anything regarding such timeout in RFC6455 and the only thing that it does in my experience is slow down the overall execution and unexpectadly close the connection. This is becauseWebSocketClient::listen()
purpose is to be called once perloop()
checking for new data and reading that data only if it actually exists. There is no specification that guarantees data within a time interval.IMHO my chages are correct, however I see how this could break some applications that rely on this behaviour. The correct way to implement a timeout is with the WebSocket Ping or with any custom ping on top. Maybe this change should be implemented with a major realease or someway to toggle it in
config.h
?Removing the timeout from
WebSocket::_read()
does not break the library (I have production code that has been running for weeks without the timeout).Btw thanks for the amazing library :smile: