Not logged in. · Lost password · Register
Forum: XMPP Protocol RSS
Avatar
mikemck #1
User title: XMPP Beginner
Member since Mar 2009 · 7 posts · Location: Hongkong
Group memberships: Members
Show profile · Link to this post
Subject: How can the client know the server is down?
Hi all,

I am the beginner use the XMPP.
I have a question, how can the client know the server is down?

When my client is login to the jabber server, then I disconnect the server side network cable.
But my client don't know the server is down. And I send the msg again. the client also don't know the server is down and sent the msg out.

Does the client side have a function to check the connection is break?

Mike
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
subscribe to the OnClose an Error events in agsXMPP and you get notified when the connection was closed.
If you can't reconnect after close then the server or your network maybe down.

Alex
Avatar
mikemck #3
User title: XMPP Beginner
Member since Mar 2009 · 7 posts · Location: Hongkong
Group memberships: Members
Show profile · Link to this post
Alex,

Thanks for your answer.
Then I have another question,
How can I write a code to auto login in the server 2, when server 1 is down?

Mike
Avatar
Alex #4
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You don't need to write any code for this. You need a server with clustering support and setup SRV records for your servers. When connect to one server fails then agsXMPP tries automatically to connect to the next server listed in your SRV records.

Alex
Avatar
mikemck #5
User title: XMPP Beginner
Member since Mar 2009 · 7 posts · Location: Hongkong
Group memberships: Members
Show profile · Link to this post
                                                                                                                                                                                                                                                                                                                                                                                                       Thanks a lot Alex.

But I also have a question,

This is the environment:
1. Two servers have different computer name, And this two servers is parallel run in same environment.
2. Two jabber servers are the same setting, same domain(e.g: @abc).

Question:
1. Many clients login to server1 in the normal time. But server1 is down, then I want to know clients can auto connect to server2 or not?
This post was edited on 2009-05-11, 11:14 by mikemck.
Avatar
Alex #6
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
if your servers support clustering and is configured correct then everything goes automatically.
This post was edited on 2009-05-12, 07:27 by Alex.
Avatar
mikemck #7
User title: XMPP Beginner
Member since Mar 2009 · 7 posts · Location: Hongkong
Group memberships: Members
Show profile · Link to this post
Thanks a lot, 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: