سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top