powered by Jive Software

Will it be problem when I Register an exist account manytimes?

hi,

I’'m writing a windows service, The service reads operations from a table of Sql server and process it to jabber server(wildfire), if the operation processed fail, the service will re-process it.

when I test the program, I try to register an exist account, jabber server returns conflict, so the program will process the operation again and again

The problem is that after the operation fails many times(such as 350 times), the service still call the xmppcon.open with “XmppCon.RegisterAccount = true;” to register, But the jabber server returns nothing, and these three events alse didn’'t occur:“XmppCon.OnError XmppCon.OnXmppError XmppCon.OnSocketError”

So I want to ask, does anybody know why this happens? thanks

Hi solar,

Using Smack I wrote a simple program that tried to register the same account 1000 times and each time I recieved an error code of 409 (account already exists), so it sounds like there might be a problem with the client library you’‘re using and/or your implementation. What library are you using? Do they have forums or a mailing list you can post to? Have you tried testing against another XMPP server (not that you’'d want to use anything other than Openfire )?

Thanks,

Ryan

Looks like he must be using agsXMPP SDK

solar: Their forums are here

Nice find, Brad.

yes, I’'m using agsXMPP,

Is it a know bug? I’‘ll ask this problem in agsXMPP’'s forum. if you have any information, please tell me , thank you

thanks for all of you.

hi ryang

would you pass me the simple program you wrote with Smack?

I think I can learn something from your program

thank you very much:)

my email is solar-sunng@163.com

The Smack Documentation has some example code that’'s pretty easy to follow

Hi Solar,

I can’‘t say if it’‘s a bug with agsXMPP, although I would kind of doubt it. You’'d definitely be better off asking in their forums.

Here is my code, all 28 lines of it

import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException; public class SimpleSmack {
   public static void main(String[] args) {
      new SimpleSmack();
   }    private SimpleSmack() {
      int count = 0;
      while (count < 1000) {
         System.out.println(count);
         XMPPConnection connection = null;
         try {
            connection = new XMPPConnection("localhost");
            connection.connect();
            connection.getAccountManager().createAccount("jack", "jack");
         } catch (XMPPException e) {
            System.out.println(e.getXMPPError());
         } finally {
            connection.disconnect();
         }
         count++;
      }       System.exit(0);
   }
}

Cheers,

Ryan