Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
anvu85 #1
Member since Jan 2013 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: high availability and multiple connection for XmppClientConnection
Hi agsXmpp supporters,
I am trying to set up 2 instances of XmppClientConnection, let's call them A and B, with same username, password, server, and port so that when one instance goes down, the other instance can still maintain the connection, listen to, and send messages from/to a client C.
How should I go about this?
Right now I have 2 instances of XmppClientConnection running with same configuration. It seems like the first instance A can send and receive message from client C, a Spark client. The other instance B is just sit there getting nothing. When I disable the first instance A, I expect the other instance B to be the backup and can jump in and handle communication, but it's not working because if I disable the first instance, I call close the connection: xmppCon.Close() and C can't send message to B base on the fact that OnXmppConnectionStateChanged: Disconnected.
I need some direction on how to set up and configure 2 xmppClientConnection with same configuration. For example, I can both login to Spark and agsxmpp Simple Client with the same username and login, when I log out Spark, the other Simple Client can still listen and send message on behalf of that same username, correct?
Thank you,
An.
Avatar
anvu85 #2
Member since Jan 2013 · 5 posts
Group memberships: Members
Show profile · Link to this post
Subject: I got the conflict error when the instance B trying to connect
xmppCon_OnReadXml: <stream:error xmlns:stream="http://etherx.jabber.org/streams"><conflict xmlns="urn:ietf:params:xml:ns:xmpp-streams" /></stream:error>
Avatar
anvu85 #3
Member since Jan 2013 · 5 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #1
Subject: Nevermind, I found the bug
Hi,
I figured it out. I forgot to set the unique resource for both A and B.
After I set the resource for both A and B, it works as I expected.
An.
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes, each connection needs a unique resource. then you can have multiple concurrent connections for the same user id
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: agsXMPP RSS