Add possibility to change WEBSOCKETS_TCP_TIMEOUT #766
Merged
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Within #501
WEBSOCKETS_TCP_TIMEOUTwas changed to 5 seconds, which is a very large number, especially when dealing with a lot of clients inside local network environment. #501 was marked as solution for #441 but I don't believe that it's proper way to deal with this problem. There should be possibility to change this parameter, which is mentioned in #661.This PR wraps
WEBSOCKETS_TCP_TIMEOUTinside#ifndefto allow defining this variable for custom setup.There is still room for improvement, like @adamczuk-piotr proposed, there could be two different timeout variables, one responsible for connecting, and another one for reading. Having one for writing data would be great as well. I can implement it but I would like to get feedback from author if it makes sense.