Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
dtjoa #1
Member since Jul 2012 · 39 posts
Group memberships: Members
Show profile · Link to this post
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
Avatar
Alex #2
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
are you running the latest version of MatriX?

This is how I read your log:
You get disconnected because of a 404 error from a HTTP result. So either you Bosh server, connection manager or HTTP proxy returns it. The same error comes back when you try to recover.

But as long as you don't know how this can be caused and of there is a problem in MatriX there is not much we can do.

Alex
Avatar
dtjoa #3
Member since Jul 2012 · 39 posts
Group memberships: Members
Show profile · Link to this post
Alex,

Assuming that the server or other things caused the problem, I was wondering whether there is a way that I can do on the client side (since I have more control on the client codes) to clear my side to be able to start a new connection to the server. What I encounter now is that when this problem happens, I can't recover the connection unless I exit my client and start it over.

It seems that Matrix library still holding on to something even after I calls XmppClient.Close(). I was wondering whether Matrix library can clean/clear everything when XmppClient.Close() is called to allow fresh connection to be attempted again.
Avatar
Alex #4
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You did not answer my questions. Which MatriX version are you using exactly?

Quote by dtjoa:
Assuming that the server or other things caused the problem, I was wondering whether there is a way that I can do on the client side (since I have more control on the client codes) to clear my side to be able to start a new connection to the server. What I encounter now is that when this problem happens, I can't recover the connection unless I exit my client and start it over.

When your server is down and returns 404 errors as it did in your log then there is no way to recover.

Quote by dtjoa:
It seems that Matrix library still holding on to something even after I calls XmppClient.Close(). I was wondering whether Matrix library can clean/clear everything when XmppClient.Close() is called to allow fresh connection to be attempted again.
MatriX should cleanup everything. But this does not mean that there still could be a problem under some conditions. So we need to know how to cause this state.

You can always destroy and recreate the complete XmppClient object.

Alex
Avatar
dtjoa #5
Member since Jul 2012 · 39 posts
Group memberships: Members
Show profile · Link to this post
I was running Matrix version 1.5.1.3.

I'll try version 1.5.1.9, and implement destroying Xmpp objects when the app fails to recover after certain number of attempts.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: