private void XMPP_Ended(Exception ex, XMPP xmpp)
{
if (xmpp.IsCancelled || ex == null)
{
OperationCancelled(this);
}
else if (xmpp.IsSubscribed)
{
RunXMPP();
}
else
{
XMPPReconnectTimer = new Timer(new TimerCallback(XMPP_Reconnect), null, XMPPReconnectInterval, new TimeSpan(-1));
Logger.Log(LogLevel.Warning, "XMPP connection broken - exception:\n{0}", ex);
}
}