Unable to Reconnect Back to Server #1261
Unanswered
chaucad-mvla
asked this question in
Q&A
Replies: 1 comment 3 replies
-
The Socket.IO client has its own reconnection logic, you do not need to do anything. The Alternatively, you may want to look into using the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a script running locally on my pc and a server hosted on Replit. My project uses socketio to send screenshots of my desktop to essentially stream my desktop to a website. However, when the Replit server shuts down or restarts, the program still runs
emit()
without throwing any errors. I tried re-establishing the connection usingbut after re-establishing the connection, nothing happens, no errors and my program still emits events that aren't being received by the server.
I can detect when the server shuts down by having the server send a heartbeat to my script and checking if the time between the heartbeats has been over x seconds an this works fine. However after detecting the server down and repeatedly trying to establish a connection again, the connection attempt appears to work but no connection is actually established. The reason I say appears is because there are no errors when emitting and the
connect()
function doesn't throw any errors either. The weirdest part is that when the server is down, nothing happens on the client, it's still able toemit()
. However, after I turn the server back on, the server doesn't receive anything from the client even though the client isn't throwing any errors. Additionally, If I restart the client it can make the requests like normal and they're received by the server.To sum it up, the client doesn't throw errors after the server stops, and after the server turns back on, it can't receive anything from the client. Sorry if this post has been confusing.
Here is the code on the server
Here is the code running on the client (local python)
Beta Was this translation helpful? Give feedback.
All reactions