AnsweredAssumed Answered

connectionClosedOnError() getting called frequently in smack android application.

Question asked by Darshana on Mar 1, 2016

Hello everyone,

 

I'm developing android chat application using smack and Openfire.

The Connection gets closed with the following error logs:

 

AbstractXMPPConnection: java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)

AbstractXMPPConnection:     at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:592)

AbstractXMPPConnection:     at libcore.io.IoBridge.recvfrom(IoBridge.java:556)

/AbstractXMPPConnection:     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:485)

AbstractXMPPConnection:     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)

AbstractXMPPConnection:     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)

AbstractXMPPConnection:     at java.io.InputStream.read(InputStream.java:162)

AbstractXMPPConnection:     at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:194)

AbstractXMPPConnection:     at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:153)

AbstractXMPPConnection:     at java.io.InputStreamReader.read(InputStreamReader.java:231)

AbstractXMPPConnection:     at java.io.BufferedReader.read(BufferedReader.java:325)

AbstractXMPPConnection:     at org.jivesoftware.smack.util.ObservableReader.read(ObservableReader.java:41)

AbstractXMPPConnection:     at org.kxml2.io.KXmlParser.fillBuffer(KXmlParser.java:1515)

AbstractXMPPConnection:     at org.kxml2.io.KXmlParser.peekType(KXmlParser.java:992)

AbstractXMPPConnection:     at org.kxml2.io.KXmlParser.next(KXmlParser.java:349)

AbstractXMPPConnection:     at org.kxml2.io.KXmlParser.next(KXmlParser.java:313)

/AbstractXMPPConnection:     at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:1169)

/AbstractXMPPConnection:     at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon nection.java:948)

AbstractXMPPConnection:     at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:963)

AbstractXMPPConnection:     at java.lang.Thread.run(Thread.java:818)

 

Even if i switch network same error gets called.

Thanks in advance.

Outcomes