Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
jeffKotula #1
Member since Aug 2011 · 12 posts
Group memberships: Members, Premium
Show profile · Link to this post
Subject: Cannot reconnect when presence is "stolen"
I've implemented reconnect logic as described in other threads, and it seems to work fine for network problems. However, if presence is "stolen" -- that is another application with the same presence information is created (on the same workstation) -- then the reconnect does not work. If I fully recreate the XmppClient object then it does seem to work.

In my OnClose() handler I call Close() (just in case) then set up a timer to call Open() every 20 seconds. Note that I use the BeforeSendPresence handler to know that my connection is ready. However, the SendXML handler is never even called so it doesn't look like my calls to Open() are having any effect...
Avatar
Alex #2
Member since Feb 2003 · 4307 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Are you on Sockets or Bosh?
Which server are you using?
Do yo have a log which shows the error message when you get kicked out because of a resource conflict?

Alex
Avatar
jeffKotula #3
Member since Aug 2011 · 12 posts
Group memberships: Members, Premium
Show profile · Link to this post
Sockets, using Coversant on the server.

Here's the log (lines with [] are my markers for the event handlers that are called) that occurs when presence is stolen. Note that after these events I never see anything else in my log output when I call Open():

[ReceiveXmlHandler event]
<error xmlns="urn:ietf:params:xml:ns:xmpp-streams">
  <conflict xmlns="urn:ietf:params:xml:ns:xmpp-streams" />
  <text xmlns="urn:ietf:params:xml:ns:xmpp-streams" lang="en-US">Resource Conflict</text>
</error>

[ReceiveXmlHandler event]
</stream:stream>

[SendXmlHandler event]
</stream:stream>

[CloseHandler event]
Avatar
Alex #4
Member since Feb 2003 · 4307 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
sorry, but I cannot cause your problems on either an ejabberd or Openfire server.

normally you should get an OnStreamError event followed by an OnClose event.

Are you running the latest binary?
I have no access to a Coversant server. When you create an test account for me on your server I can try to debug this.

Alex
Avatar
jeffKotula #5
Member since Aug 2011 · 12 posts
Group memberships: Members, Premium
Show profile · Link to this post
Hm. My library is from last April I think. I should probably update it. Will the same licensing string work?
Avatar
Alex #6
Member since Feb 2003 · 4307 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
you license key is valid for 12 month updates. After 12 month you have to renew the license to use the latest builds for another 12 month again.

But we have not changed this behavior for a while. So it should also work with very old versions.

Alex
Avatar
jeffKotula #7
Member since Aug 2011 · 12 posts
Group memberships: Members, Premium
Show profile · Link to this post
Interesting. I stumbled across the solution. I moved the initial creation of presence out of the main Form's constructor and put it into the Form's OnLoad() method (in my Windows Forms app). Apparently creating the presence before the main event loop is up and running can mess things up...
Avatar
Alex #8
Member since Feb 2003 · 4307 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
weird, don't send out presence before the OnLogin or Better OnRosterEnd event.

Alex
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:
Forum: MatriX RSS