Tigase XMPP Ping solution
I am looking for a solution for identifying dead client connection to tigase server which was active previously.
I would like to know how to check whether a client is still actively connected to the server or not.
There might be cases when the network connection from client can go down/explicit termination of network by the user.
Here I would like to get the status updated as unavailable for the client so that remaining connected contacts for the client will see it as unavailable instead of available.
Will the ping module help in identifying this.[XEP-0199] . If so how to configure that to address this issue.
I do not want to depend on underlying operating systems keep alive settings on TCP side, instead looking for a solution from Tigase server side.
I did some testing around this by explicitly pulling out the network cable for a connected client, and in other contacts roster , this client was showing online for long time.
I could not find the status getting changed to unavailable or server sending an unavailable packet for this user.
Added by Artur Hefczyc over 5 years ago
Usually the motivation behind early broken connection discovery is to keep the user connected at all time. Then, as soon as the broken connection is detected, the client software reconnects to keep the user online all the time if possible. For such cases XMPP ping from the server side or any line test from the server side is not good enough as the server can do very little for broken connection. It can only cleanup resources and notify contacts about the user gone offline.
The server has no way to reconnect the client or to notify the client about connection broken. Therefore, server side ping are not effective, moreover, they are resource consuming.
For this reason, on most installations, the line test (XMPP ping or similar techniques) are initiated from the client side. This way they quickly discover broken connections and reconnect, also notifying the server that the old connection is no longer valid.
If the main or the only motivation for the server side initiated pings is to early inform contacts about the user disconnected I am not sure if this is really worth the effort and extra resources on the server side. Please note, most of the broken connection cases are discovered very quickly and this is not an issue. The only case when the system has difficulties with discovering connection is when you pull the cable from the computer port. And this is only because the OS expects the cable to be plugged back soon and is waiting with all the connections still in online state. However, please consider how often this really happens? Is this really that frequent to even bother about it? From our experience it does not happen almost at all. And another question, let's assume it does happen in some rare cases. Is it really that important for you to handle this one a year case for a single user to employ the whole server side ping stuff?
For all these reasons we did not implement server side pings in Tigase yet.