Question

Assuming long chat conversations, the connection between Jabber chat clients is likely to get disconnected eventually.

How does one go about detecting that a connection from a Strophe.js based jabber client?

Was it helpful?

Solution

Strophe manages connection status changes through events. There appears to be no easy way to query the status of a given connection, but it's fairly straight forward to keep track of it.

The "connect" message on a Strophe.Connection takes a function, which will then be called on any connection status change. Keep track of current status within that function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top