On this code i just changed xmppConnectionHandle = new XMPPConnection(Constants.gconfig); to xmppConnectionHandle = new XMPPTCPConnection(Constants.gconfig); after the migration to 4.0.3
Once after this if i am idle for 60 secs and then i try to check for support registration and try to register this is when i get the no server response … it send the packet to server but it never reaches to the server but isConnected retruns always true ? Any ideas why ?
Previously when its connected it started sending pings to server but now it doesnt send automatically i used pingmanger but it works only if the user logins and is authenticated else it doesnt send.
Once after this if i am idle for 60 secs and then i try to check for support registration and try to register this is when i get the no server response
Why do you wait 60 seconds before registering an account?
Any ideas why ?
Not with the provided information, sorry.
Previously when its connected it started sending pings to server but now it doesnt send automatically i used pingmanger but it works only if the user logins and is authenticated else it doesnt send.
Most servers don’t respond to pings if the user isn’t authenticated. So this is intended behavior.
Its like this that i am having this delay 60-130 secs to make sure user confrims email address and the details that he entered on his email or on the screen.
It also happens if i don register but try to login .
But if I login quickly all works good .
This is was working propely and did nothave issues before 4.0.3
Also to confirm what i did i created a small code on Java - SMACK - and tried to replicate it … and it worked properly but was getting many repeated errors
Aug 20, 2014 08:55:49 PM org.jivesoftware.smack.XMPPConnection callConnectionClosedOnErrorListener
WARNING: Connection closed with error
java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag <stream:stream> from line 1, parser stopped on END_TAG seen ...xmlns=\'http://jabber.org/features/iq-register\'/></stream:features>... @1:642
at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3035)
at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:279)
at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:47)
at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:81)
But even after this erros i can login … connection is not terminated. newConnect.java.zip (710 Bytes)
Could you then please reword your problem and enable Smack debug and post a stanza trace. Right now I’m having problems following your problem description.
when i was using asmack 3.2.2 i was first connecting using xmppConnectionHandle.connect(); once the connection was successful i was able to wait ( have delay ) and then perfrom next steps like xmppConnectionHandle.login() or register a user .
whenever the connection was done i see that asmack sends following sequnces for connecting
**DEBUG 3.2.2 asmack client - server ejabberd 14.07
**
On SmackConfiguration.getVersion());
08-21 05:20:11.716 1614-1614/com.griffin D/AsmackVersion﹕ 3.2.2 on xmppConnectionHandle.connect(); 08-21 05:20:12.066 1614-1637/com.griffin D/SMACK﹕ 05:20:12 AM SENT (-1377776776): <stream:stream to="ec2-78-121-132-5.compute-1.amazonaws.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
08-21 05:20:12.296 1614-1638/com.griffin D/SMACK﹕ 05:20:12 AM RCV (-1377776776): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='775196724' from='ec2-78-121-132-5.compute-1.amazonaws.com' version='1.0' xml:lang='en'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> After the above sequence the smack automatically sends empty streams like below ( during my wait or delay) 1614-1639/com.griffin D/SMACK﹕ 05:22:27 AM SENT (-1377776776):
1614-1639/com.griffin D/SMACK﹕ 05:22:57 AM SENT (-1377776776):
1614-1639/com.griffin D/SMACK﹕ 05:23:27 AM SENT (-1377776776):
1614-1639/com.griffin D/SMACK﹕ 05:37:27 AM SENT (-1377776776): At this point server and client are both connected even after connect was called 5:20 and i was idle for next 17 mins till 5:37 though server doesnot respond anything ( as you see above only sents and no rcv) Now i invoke xmppConnectionHandle.login() and still i am connected and i get response from the server and user is authenticated
1614-1637/com.griffin D/SMACK﹕ 05:39:35 AM SENT (-1377776776): <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl"></auth>
1614-1638/com.griffin D/SMACK﹕ 05:39:35 AM RCV (-1377776776): <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>bm9uY2U9IjY1Njg4Nzc4MiIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==</challenge>
1614-1637/com.griffin D/SMACK﹕ 05:39:35 AM SENT (-1377776776): <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl">dXNlcm5hbWU9Iis5MTk3NjQyMjQwMDMiLHJlYWxtPSJlYzItNzUtMTAxLTEzMi01LmNvbXB1dGUtMS5hbWF6b25hd3MuY29tIixjbm9uY2U9ImUyNWZiNzdmM2QzM2IwMmUzYzRmN2FmMGQ0NWM5NjQ5ZjFkMjY4YWUyNGEzYWYyNmFlNzNlZjBlOWMyZDJjNmUiLG5jPTAwMDAwMDAxLHFvcD1hdXRoLGRpZ2VzdC11cmk9InhtcHAvZWMyLTc1LTEwMS0xMzItNS5jb21wdXRlLTEuYW1hem9uYXdzLmNvbSIscmVzcG9uc2U9MmEyYzExYjFiYzBhMjcxNzYzMGI3ZWJlNGNlN2M5NDEsY2hhcnNldD11dGYtOCxub25jZT0iNjU2ODg3NzgyIg==</response>
1614-1638/com.griffin D/SMACK﹕ 05:39:36 AM RCV (-1377776776): <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>cnNwYXV0aD04ZTA2NDQ2MThhZDg4YTU2ZTVjNTU5MzBiZDZmZDc1MQ==</challenge>
08-21 05:39:36.036 1614-1637/com.griffin D/SMACK﹕ 05:39:36 AM SENT (-1377776776): <response xmlns="urn:ietf:params:xml:ns:xmpp-sasl"></response>
08-21 05:39:36.246 1614-1638/com.griffin D/SMACK﹕ 05:39:36 AM RCV (-1377776776): <success xmlns='urn:ietf:params:xml:ns:xmpp-sasl'/>
08-21 05:39:36.896 1614-1614/com.griffin D/griffin:GriffinAccounts﹕ Authenticated user
08-21 05:39:36.896 1614-1637/com.griffin D/SMACK﹕ 05:39:36 AM SENT (-1377776776): <iq id="lO01x-2" type="get"><query xmlns="jabber:iq:roster" ></query></iq>
08-21 05:39:36.906 1614-1637/com.griffin D/SMACK﹕ 05:39:36 AM SENT (-1377776776): <presence id="lO01x-4"></presence>
08-21 05:39:36.916 1614-1637/com.griffin D/SMACK﹕ 05:39:36 AM SENT (-1377776776): <presence id="lO01x-3"><status>Gone fishing</status></presence>
08-21 05:40:27.606 1614-1639/com.griffin D/SMACK﹕ 05:40:27 AM SENT (-1377776776):
08-21 05:40:57.616 1614-1639/com.griffin D/SMACK﹕ 05:40:57 AM SENT (-1377776776): per the timestmps you will see that after my connect method to login method there was delay ~19 mins and i could still authenticate. netstat on android phone is always established during all phases above.
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 ::ffff:10.0.2.15:36867 ::ffff:78.121.132.5:5222 ESTABLISHED
If upgrade my client asmack to 3.3.1 or 4.0.3 i have to do xmppConnectionHandle.connect() and xmppConnectionHandle.login() or register a user . without a delay else i cannot autheticate or register. see the debug below
DEBUG 3.3.1 or 4.0.3 asmack client - server ejabberd 14.07
On SmackConfiguration.getVersion());
08-21 05:55:19.086 1614-1614/com.griffin D/AsmackVersion﹕ 3.3.1 on xmppConnectionHandle.connect(); 1709-1731/com.griffin D/SMACK﹕ 05:55:19 AM SENT (-1376867064): <stream:stream to="ec2-78-121-132-5.compute-1.amazonaws.com" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
1709-1732/com.griffin D/SMACK﹕ 05:55:19 AM RCV (-1376867064): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='486885245' from='ec2-78-121-132-5.compute-1.amazonaws.com' version='1.0' xml:lang='en'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism><mechanism>PLAIN</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='r0RBB+5aC6S1U+mJ50q7+TjV47E='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features> After the above sequence the smack DOEST NOT automatically sends empty streams like it was in above debug 08-21 06:00:44.826 1709-1731/com.griffin D/SMACK﹕ 06:00:44 AM SENT (-1376867064): <auth mechanism="DIGEST-MD5" xmlns="urn:ietf:params:xml:ns:xmpp-sasl"></auth>
08-21 06:01:14.896 1709-1731/com.griffin D/SMACK﹕ 06:01:14 AM SENT (-1376867064): <iq id="0EQ53-0" type="get"><query xmlns="jabber:iq:auth"><username>+919764224003</username></query></iq>
08-21 06:01:24.906 1709-1709/com.griffin W/System.err﹕ No response from the server.:
08-21 06:01:24.936 1709-1709/com.griffin W/System.err﹕ at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication.java:73)
08-21 06:01:24.946 1709-1709/com.griffin W/System.err﹕ at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java:352)
08-21 06:01:24.956 1709-1709/com.griffin W/System.err﹕ at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:242)
08-21 06:01:24.956 1709-1709/com.griffin W/System.err﹕ at com.griffin.GriffinAccounts.gLogin(GriffinAccounts.java:65) Though the client send the the packet it never reaches the server and so server does not respond netstat on android phone @ 05:55:19 AM soon after connect
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 ::ffff:10.0.2.15:51097 ::ffff:78.121.132.5:5222 ESTABLISHED netstat on android phone @ 05:56:21 AM 1 min after connect
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 ::ffff:10.0.2.15:51097 ::ffff:78.121.132.5:5222 CLOSE_WAIT
I think the chnages were done on purpose to remove whitespace pings as part of https://igniterealtime.org/issues/browse/SMACK-412 to implement it with a XEP-0199 ping however this pings work only after the successful authentication .
During this change i guess the socket is getting closed after 1 min
netstat on android phone @ 05:56:21 AM 1 min after connect
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp6 0 0 ::ffff:10.0.2.15:51097 ::ffff:78.121.132.5:5222 CLOSE_WAIT
How to change XMPP ping manually ?
If its by using Pingmanager then i have already tried it it works only after the login phase and not between connect and login
Besides the real solution for your problem would be to query the user for the required information regarding registration and then connect and to the registration. Not connect, query the user, do the registration.
yea this can be a workaround i will try if it works i will have to keep on sending the pings(though server will respond with service un available i am not authenticated yet ) until i perform next actions.
But what i did for now is forked code from your repo and changed the XMPPTCPConnection.java and PacketWriter.java to overcome the problem that i had now it works as i want.
i ran build.bash -b 4.0 -a 19
it gave the jar file.
But i am not able to start debugger It gives following error all the time
Unable to instantiate either Smack debugger class
Can’t initialize the configured debugger!
What wrong am i doiing here during the build ? i tried to modify build.xml but it did not work