Closed GoogleCodeExporter closed 8 years ago
I've a same issue when I stop GTalkSMS and it was running for a long time.
I don't think that is due to mobile data connection but to xmpp protocol.
Can you confirm if the application was running for a long time ?
Original comment by Florent....@gmail.com
on 28 Dec 2010 at 5:37
No, it was not running for a long time. May be few hours max. I checked now:
after restarting phone and turning mobile data off, it freezed :(
Original comment by marian.t...@gmail.com
on 28 Dec 2010 at 6:03
Ok, can you do the test after few minutes of uptime ?
I'll investigate on it.
Original comment by Florent....@gmail.com
on 28 Dec 2010 at 10:28
FWIW, this hang seems to be an issue with the smack library. See my note about
it in http://code.google.com/p/talkmyphone/issues/detail?id=51#c7. Discussing
this before with Christophe-Marie, he indicated he thought the best thing to
try and do was use 'asmack' as the XMPP library, but I failed to get that going
due to complexities in the asmack build process (it really is just a set of
patches to smack itself)
Original comment by skippy.hammond@gmail.com
on 28 Dec 2010 at 10:38
Here
http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp we
can find a zip that included smack library with android's patches (I think
that is asmack version).
Original comment by Florent....@gmail.com
on 28 Dec 2010 at 10:54
It seems to me, that explanation is in Issue 12.
When I turn off mobile data and after few minutes turn it on, gtalksms is
running again. The application is not reacting between these two points. I
didn't tried this before.
Original comment by marian.t...@gmail.com
on 29 Dec 2010 at 8:12
Issue 12 should stop the app from hanging - but it may not fix the inability to
disconnect from the mobile network. What I expect to see now is that the app
keeps running, but is unable to auto-reconnect when wifi becomes available.
This problem may also be limited to a device and/or version of android - I've
seen a number of people report it with TMP on a Desire, which is what I have.
Original comment by skippy.hammond@gmail.com
on 29 Dec 2010 at 11:05
Can you try again with v1.4 please? It's available on market
Original comment by Florent....@gmail.com
on 29 Dec 2010 at 11:06
I just tried and it is as I predicted - the disconnect never finished, although
the app remains responsive. The hang is in XMPPConnection.shutdown(), which is
called as part of disconnect. I'll dig a little more for a workaround.
Original comment by skippy.hammond@gmail.com
on 30 Dec 2010 at 12:07
FWIW, the smack.jar at http://people.apache.org/~dims/android/ is what we are
currently using (I just grabbed it - the .jar is identical). FWIW, I don't
think that has any relationship to 'asmack', which is a far larger set of
patches.
Original comment by skippy.hammond@gmail.com
on 30 Dec 2010 at 1:10
asmack binaries can be got from http://code.google.com/p/asmack/ - sadly
though, I did very quick testing with the .jar from there and got the exact
same results. It might be worth testing it more thoroughly as it may work
better in some other ways - but not in this specific case.
So I knocked up a patch that does the disconnect in its own thread - as the
comments say, it isn't ideal, but probably better than hanging. In my testing
I eventually saw the hung thread terminate up to 30 minutes later, so hopefully
it will not result in lots of hung threads in the process. Works for me :)
Original comment by skippy.hammond@gmail.com
on 30 Dec 2010 at 7:28
Attachments:
if there is now data connection, xmpp never can a clean disconnection.
So XMPPConnection.shutdown() is really necessary ?
This function notify the server that we closing connection but we can't contact
the server.
Original comment by Florent....@gmail.com
on 30 Dec 2010 at 11:06
I guess we might want to clean-up the socket etc - but yeah, that may well work
too. I wonder which one sucks least? :)
Original comment by skippy.hammond@gmail.com
on 30 Dec 2010 at 12:14
Actually, a problem with that is that the xmpp stuff keeps at least 3 thread
alive - a packet reciever, transmitter and a keep-alive watcher - so we would
probably end up leaking 3 threads instead of one trivial one...
Original comment by skippy.hammond@gmail.com
on 30 Dec 2010 at 12:21
Original comment by Florent....@gmail.com
on 1 Jan 2011 at 9:53
Original comment by fschm...@gmail.com
on 25 Aug 2011 at 7:51
Original issue reported on code.google.com by
marian.t...@gmail.com
on 28 Dec 2010 at 8:54