Subject: how to recover after BoshException
I am not able to recover the connection to XMPP server after BoshException. What i did to try to recover was closing the XmppClient and checking StreamActive to make sure it is closed before opening a new one. It seems that in this case, StreamActiveis never cleared. See some log messages. Unfortunately, I didn't have the BOSH log enabled, and it is not easily to reproduce the problem.
I try to have the ability to recover the XMPP connection without having to restart my application.
2012-12-06 09:20:19,204 [1] INFO CmXmpp.XmppPresenter - OnCreateBoshSession
2012-12-06 09:20:19,433 [1] WARN CmXmpp.XmppPresenter - OnError(Matrix.Net.BoshException: BoshException ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at #=qKkdH6HdEGNHwG2LMdqeFqREb4CubSocdKOaCl4$aUkQ=.#=qoRllyUvp3L6$89m00OD_Mg==(IAsyncResult #=qQTD02PTcOGl0q$iYsfAPTg==)
--- End of inner exception stack trace ---)
2012-12-06 09:20:19,435 [1] INFO CmXmpp.XmppPresenter - Change state eConnecting to eWaitRetryTimeout
2012-12-06 09:20:19,436 [1] INFO CmXmpp.XmppPresenter - OnLostXmppConnection() restart connection in 3149 milliseconds
2012-12-06 09:20:19,440 [1] WARN CmXmpp.XmppPresenter - OnError(Matrix.Net.BoshException: BoshException ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at #=qKkdH6HdEGNHwG2LMdqeFqREb4CubSocdKOaCl4$aUkQ=.#=qoRllyUvp3L6$89m00OD_Mg==(IAsyncResult #=qQTD02PTcOGl0q$iYsfAPTg==)
--- End of inner exception stack trace ---)
2012-12-06 09:20:22,585 [1] INFO CmXmpp.XmppPresenter - OnTimeoutExpired(eWaitRetryTimeout,True,True)
2012-12-06 09:20:22,608 [1] WARN CmXmpp.XmppPresenter - OnTimeoutExpired() previous connection isn't closed
2012-12-06 09:20:22,609 [1] INFO CmXmpp.XmppPresenter - OnTimeoutExpired() restart connection in 3594 milliseconds
2012-12-06 09:20:26,207 [1] INFO CmXmpp.XmppPresenter - OnTimeoutExpired(eWaitRetryTimeout,True,True)
2012-12-06 09:20:26,207 [1] WARN CmXmpp.XmppPresenter - OnTimeoutExpired() previous connection isn't closed
2012-12-06 09:20:26,207 [1] INFO CmXmpp.XmppPresenter - OnTimeoutExpired() restart connection in 3073 milliseconds
I try to have the ability to recover the XMPP connection without having to restart my application.
2012-12-06 09:20:19,204 [1] INFO CmXmpp.XmppPresenter - OnCreateBoshSession
2012-12-06 09:20:19,433 [1] WARN CmXmpp.XmppPresenter - OnError(Matrix.Net.BoshException: BoshException ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at #=qKkdH6HdEGNHwG2LMdqeFqREb4CubSocdKOaCl4$aUkQ=.#=qoRllyUvp3L6$89m00OD_Mg==(IAsyncResult #=qQTD02PTcOGl0q$iYsfAPTg==)
--- End of inner exception stack trace ---)
2012-12-06 09:20:19,435 [1] INFO CmXmpp.XmppPresenter - Change state eConnecting to eWaitRetryTimeout
2012-12-06 09:20:19,436 [1] INFO CmXmpp.XmppPresenter - OnLostXmppConnection() restart connection in 3149 milliseconds
2012-12-06 09:20:19,440 [1] WARN CmXmpp.XmppPresenter - OnError(Matrix.Net.BoshException: BoshException ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at #=qKkdH6HdEGNHwG2LMdqeFqREb4CubSocdKOaCl4$aUkQ=.#=qoRllyUvp3L6$89m00OD_Mg==(IAsyncResult #=qQTD02PTcOGl0q$iYsfAPTg==)
--- End of inner exception stack trace ---)
2012-12-06 09:20:22,585 [1] INFO CmXmpp.XmppPresenter - OnTimeoutExpired(eWaitRetryTimeout,True,True)
2012-12-06 09:20:22,608 [1] WARN CmXmpp.XmppPresenter - OnTimeoutExpired() previous connection isn't closed
2012-12-06 09:20:22,609 [1] INFO CmXmpp.XmppPresenter - OnTimeoutExpired() restart connection in 3594 milliseconds
2012-12-06 09:20:26,207 [1] INFO CmXmpp.XmppPresenter - OnTimeoutExpired(eWaitRetryTimeout,True,True)
2012-12-06 09:20:26,207 [1] WARN CmXmpp.XmppPresenter - OnTimeoutExpired() previous connection isn't closed
2012-12-06 09:20:26,207 [1] INFO CmXmpp.XmppPresenter - OnTimeoutExpired() restart connection in 3073 milliseconds