-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to make a Keep-Alive effect? #1430
Comments
I made a keep-alive using a Ticker from this library to socket.textAll() clients every 30 seconds, and they reply back to server. It seems to work okay. |
@Belleson Can I have an example of how the EspAsyncWebServer library works? It's just that the problem is that it is the library that forcibly closes the socket. Maybe I don't understand something) |
This is a very good tutorial on web socket. Prevent watch dog time-outs by
Be aware callbacks for a single ticker must have enough time to finish before another message arrives. If not, tickerCallback2 will stop execution of tickerCallback1, so this is good for human interface but not for fast client-server data processing. Client javascript code will also have a message handler function. Sample server code for asynchronous message processing (not tested to compile or run):
Good luck, I hope you find a solution. |
@Belleson I don't use web sockets, I only have a standard http server |
My mistake, when you said keep the socket open I made a bad assumption that you were using web sockets. Maybe you could use a Ticker in a similar way so the server reloads a one pixel graphic on the page as a refresh? |
@me-no-dev Hello. Is it possible to make a "Keep-Alive" effect? So that the web server does not close the socket for a while?
The text was updated successfully, but these errors were encountered: