What are you doing to produce the error? 1. try setting a ConnectionListener on connection and try to connect with an android device 2. try to switch to wifi and then to 3g again 3. try to send chat message
What is the expected output? the message should be received.
What do you see instead? (Please attach a debug enabled logcat) Connection status ok (no failure)
What version of aSmack / Android / Device do you use? 2010.03.03 and android 1.6 device
What server do you use? Is there a public server to reproduce the problem? Gtalk server
What else might help us to reproduce and hunt down the problem? I have to say that the library does not work as good as the library (modified maybe) used by gtalk default android application.
Comment #1
Posted on Mar 30, 2010 by Massive CatI am using XMPPConnection. Could a boshConnection provide a more reliable connection to server?
Comment #2
Posted on Apr 3, 2010 by Grumpy RhinoThe problem is at the lowest level: TCP. The TCP phone stack is designed to survive a handover to a new cell, in a train. Which means it's design to survive multiple minutes of silence.
This is contrary to "real-time". Here is a good/common workaround: implement server ping and check for fast replies, drop the connection / reconnect.
You can either look into the jabbroid code for ping or into the buddycloud code for reader/writer based checking (hint: the reader/write is "protected" in asmack, so extending the XMPPConnection class may help).
BOSH has stream management "for free". So it might help to use it (at least for delivery reliability.)
WontFix the ticket because it's not an asmack bug but rather a TCP level problem.
Regards, René
PS: gtalk uses a modified smack lib, too. But I'm still far from the same stability. Help would be appreciated.
Comment #3
Posted on Apr 3, 2010 by Massive CatHi Rene, thanks for your answer. I was looking at buddycloud code...just to be clear, the code you were talking about is a sort of scheduler that checks the status of a connection and reconnect eventually right? Is this heavy for battery consumption? About this I am trying to understand wich system is the best for reliability/battery ratio. Indeed soon I would like to create an open project based heavily on xmpp but first we have to solve these problems. Anyway if you want help, I would be glad to help you for the sake of open source and open protocols.
Comment #4
Posted on Apr 4, 2010 by Grumpy RhinoRegard help: I'm always happy merge smack improvements. And to get feedback. My trunk is at [http://github.com/rtreffer/smack github/rtreffer/smack] and [http://github.com/rtreffer/smack github/rtreffer/asmack], so feel free to fork.
Upstream patches to smack will be merged as well. Go ahead and push everything you might regard as usefull and I'll try to pull it in. Just one note: I'll keep it under the Apache Licence. As I want to maximalize the use of the lib.
As for best practices: I'll try to create some sample code, for chat / reconnect, but it's not post-login atm....
Comment #5
Posted on Jun 1, 2010 by Swift OxI have done the next test:
- start openfire
- start client
- shutdown and start openfire
- send packet from client
And I get: connectionClosedOnError java.io.IOException: Write error: I/O error during system call, Broken pipe at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.nativewrite(Native Method) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.access$600(OpenSSLSocketImpl.java:54) at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLOutputStream.write(OpenSSLSocketImpl.java:568) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:183) at java.io.OutputStreamWriter.convert(OutputStreamWriter.java:263) at java.io.OutputStreamWriter.write(OutputStreamWriter.java:252) at java.io.BufferedWriter.flush(BufferedWriter.java:145) at org.jivesoftware.smack.util.ObservableWriter.flush(ObservableWriter.java:48) at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:195) at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:42) at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:78)
So, at this moment asmack knows that the connection is broken and it is still not reconnecting. I think that in this error the asmack could recover from crash starting the reconnecting.
Im sorry if I haven't understood well but I hope this will help.
I have used asmack-2010.05.07.jar
Comment #6
Posted on Aug 12, 2010 by Happy CatI was annoyed with some of the wifi problems on my android, so I developed an app to solve them.
It's called "Fix My WiFi", and it Resolves these WiFi issues:
1) Re-connect failing on return to Access Point, or after conn drops. 2) WiFi dropping when phone left idle (Optional WiFi lock) 3) Access point available, but device not attempting to conn.
You can download it from the market.
Hope it helps!
Status: WontFix
Labels:
Type-Defect
Priority-Medium