Answer the question
In order to leave comments, you need to log in
How to check that the client has fallen off?
I am writing my own UDP server in Python, there will be a lot of clients, it is desirable to determine which of them has disconnected so as not to send messages to them.
Hence, the question is how to do it (I'm interested in the algorithm itself)?
So far, I see it this way: the client sends messages to the server, like "I'm online", while the server disconnects those clients whose waiting time has passed. Then what interval of sending messages to choose? But this can make a good ddos server.
Now I came up with another way - the activity of clients is kept, if it is less than the selected time interval, then the server itself sends a message to the client ("are you online?"). If the client does not respond, then the server removes it from the list.
I'm sure you have some other ideas about this.
Thank you!
Answer the question
In order to leave comments, you need to log in
If you use UDP, then delivery is not important to you.
Otherwise - would use TCP.
And so - telephony standard)) Two ports: one - voice (UDP), the other - signaling (TCP).
Here on the signaling and drive pings, and UDP - sent and forgotten.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question