How can you detect if someone has disconnected from a flask server?
I am using this flask server to store all of the variables, and I am using a separate python file to run the actual battleship games. I am using requests to get the values I need. However, I need a way to determine in the server if somebody has closed the tab for the other file, stopped the repl, etc. and close that room in the server. Thanks in advance.
I don't know if this is the answer to your question, but: https://stackoverflow.com/questions/14886400/checking-if-a-user-disconnects-using-flask - You can also constantly ping a site or repl to check if the server is online. If the flask server is offline, replit may add their page which says so, and you can check if the html code is listed.
i spent time on this pls give mark lol
you should use flask socketio to do this! Not only will it be what you want, its instantaneous, and sane.