Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
sunng #1
Member since Apr 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: 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", when I stop the service and start it again, jabber server can return "conflict" again, but after several times, jabber server returns nothing again.
 
So I want to ask, does anybody know why this happens? thanks
Avatar
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
you can register every username only once. This maybe the reason why the server responds with an error to your request.
You should take a closer look at the error message from the server. Don't register the account again and again if it already exists or the server does not allow you to register this account for some reason.
Software Developer
AG-Software
Avatar
sunng #3
Member since Apr 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
I know that I can register every username only once, but I wanted to test the robustness of my code, so I tried to register the same account 1000 times, I wish the jabber server returns 1000 times error to me.

when the probelem happens, i can't receive any thing throught m_XmppCon.OnReadSocketData and m_XmppCon.OnWriteSocketData, So does all of the XmppClientConnection's other events.

stopping and restarting the jabber server will not resolve the problem, but after stopping and restarting the service, It turns right again.

here is my print:


..............................

SEND_Socket: <stream:stream to='sunxiaodong' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV_Socket: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=""http://etherx.jabber.org/streams"" xmlns=""jabber:client"" from=""sunxiaodong"" id=""3d888660"" xml:lang=""en"" version=""1.0"">"
RECV_Socket: <stream:features><starttls xmlns=""urn:ietf:params:xml:ns:xmpp-tls""></starttls><mechanisms xmlns=""urn:ietf:params:xml:ns:xmpp-sasl""><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns=""http://jabber.org/features/compress""><method>zlib</method></compression><auth xmlns=""http://jabber.org/features/iq-auth""/><register xmlns=""http://jabber.org/features/iq-register""/></stream:features>"
SEND_Socket: <starttls xmlns=""urn:ietf:params:xml:ns:xmpp-tls"" />"
RECV_Socket: <proceed xmlns=""urn:ietf:params:xml:ns:xmpp-tls""/>"
SEND_Socket: <stream:stream to='sunxiaodong' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
RECV_Socket: <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream=""http://etherx.jabber.org/streams"" xmlns=""jabber:client"" from=""sunxiaodong"" id=""3d888660"" xml:lang=""en"" version=""1.0""><stream:features><mechanisms xmlns=""urn:ietf:params:xml:ns:xmpp-sasl""><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns=""http://jabber.org/features/compress""><method>zlib</method></compression><auth xmlns=""http://jabber.org/features/iq-auth""/><register xmlns=""http://jabber.org/features/iq-register""/></stream:features>"
SEND_Socket: <iq xmlns=""jabber:client"" id=""agsXMPP_697"" type=""get"" to=""sunxiaodong""><query xmlns=""jabber:iq:register"" /></iq>"
RECV_Socket: <iq type=""result"" id=""agsXMPP_697"" from=""sunxiaodong""><query xmlns=""jabber:iq:register""><username/><password/><email/><name/><x xmlns=""jabber:x:data"" type=""form""><title>XMPP Client Registration</title><instructions>Please provide the following information</instructions><field var=""FORM_TYPE"" type=""hidden""><value>jabber:iq:register</value></field><field label=""Username"" var=""username"" type=""text-single""><required/></field><field label=""Full name"" var=""name"" type=""text-single""/><field label=""Email"" var=""email"" type=""text-single""/><field label=""Password"" var=""password"" type=""text-private""><required/></field></x></query></iq>"
SEND_Socket: <iq xmlns=""jabber:client"" type=""set"" id=""agsXMPP_698"" to=""sunxiaodong""><query xmlns=""jabber:iq:register""><username>testpro6</username><password>test6</password></query></iq>"
RECV_Socket: <iq type=""error"" id=""agsXMPP_698"" from=""sunxiaodong"" to=""sunxiaodong/3d888660""><query xmlns=""jabber:iq:register""><username>testpro6</username><password>test6</password></query><error code=""409"" type=""cancel""><conflict xmlns=""urn:ietf:params:xml:ns:xmpp-stanzas""/></error></iq>"
RECV_Socket: </stream:stream>
SEND_Socket: </stream:stream>
SEND_Socket: <stream:stream to='sunxiaodong' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
SEND_Socket: </stream:stream>
SEND_Socket: <stream:stream to='sunxiaodong' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
SEND_Socket: </stream:stream>
SEND_Socket: <stream:stream to='sunxiaodong' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
SEND_Socket: </stream:stream>
SEND_Socket: <stream:stream to='sunxiaodong' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>
SEND_Socket: </stream:stream>
SEND_Socket: <stream:stream to='sunxiaodong' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en'>

..............................

Is it a bug of the agsXMPP Lib? how can I resolve it? thanks
Avatar
Jabberer #4
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
Quote by sunng:
Is it a bug of the agsXMPP Lib? how can I resolve it? thanks

i don't think so.
Your debug looks very strange, so i assume something is wrong in your source code.
Software Developer
AG-Software
Avatar
sunng #5
Member since Apr 2007 · 7 posts
Group memberships: Members
Show profile · Link to this post
hi jabberer

cause the code is a little long , so I put the code in E-mail, I have sent it to you, please check it, and my E-mail is : solar-sunng@163.com

thanks.

sunng.
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