powered by Jive Software

Connection not getting closed

with 4.1.0 - alpha 5

If i am not authenticated but connected and turn off my Wifi or internet it calls connection lister closed on error and disconnects the connection . isConnected is False.

But if am authenticated and When i turnoff my Wifi it goes to connection listner 11-03 17:04:33.905 31122-31269/com.griffin D/ConnectionsManager﹕ XMPPClosedOnError but it does not close the connection its still connected

IsConnected is true and

it also returns the connectionID

Is it a bug ?

following is stacktrace.

11-03 17:04:33.305  31122-31253/com.griffin D/ConnectionsManager﹕ HeartBeats Stopped
11-03 17:04:33.695  31122-31269/com.griffin W/AbstractXMPPConnection﹕ Connection closed with error
    java.net.SocketException: recvfrom failed: ETIMEDOUT (Connection timed out)
            at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:545)
            at libcore.io.IoBridge.recvfrom(IoBridge.java:509)
            at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
            at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
            at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
            at java.io.InputStreamReader.read(InputStreamReader.java:244)
            at java.io.BufferedReader.read(BufferedReader.java:310)
            at org.jivesoftware.smack.util.ObservableReader.read(ObservableReader.java:41)
            at org.kxml2.io.KXmlParser.fillBuffer(KXmlParser.java:1496)
            at org.kxml2.io.KXmlParser.peekType(KXmlParser.java:979)
            at org.kxml2.io.KXmlParser.next(KXmlParser.java:346)
            at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)
            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1227)
            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPConnection.java:976)
            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:995)
     Caused by: libcore.io.ErrnoException: recvfrom failed: ETIMEDOUT (Connection timed out)
            at libcore.io.Posix.recvfromBytes(Native Method)
            at libcore.io.Posix.recvfrom(Posix.java:140)
            at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
            at libcore.io.IoBridge.recvfrom(IoBridge.java:506)
            at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
            at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
            at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
            at java.io.InputStreamReader.read(InputStreamReader.java:244)
            at java.io.BufferedReader.read(BufferedReader.java:310)
            at org.jivesoftware.smack.util.ObservableReader.read(ObservableReader.java:41)
            at org.kxml2.io.KXmlParser.fillBuffer(KXmlParser.java:1496)
            at org.kxml2.io.KXmlParser.peekType(KXmlParser.java:979)
            at org.kxml2.io.KXmlParser.next(KXmlParser.java:346)
            at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)
            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1227)
            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPConnection.java:976)
            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:995)
11-03 17:04:33.905  31122-31269/com.griffin D/ConnectionsManager﹕ XMPPClosedOnError
11-03 17:04:33.910  31122-31269/com.griffin D/SMACK﹕ Connection closed due to an exception (0)
11-03 17:04:33.920  31122-31269/com.griffin D/GriffinSubscriptions﹕ Presence changed for919823401006@ec2-7-11-132-5.compute-1.amazonaws.com/892B3E63 : unavailable
11-03 17:04:33.940  31122-31269/com.griffin D/GriffinSubscriptions﹕ Presence changed for919764224566@ec2-7-11-132-5.compute-1.amazonaws.com/383EF2F4 : unavailable

This happens only when SM is enabled … if SM is off it works fine.

@Flow – Any pointers on this ?? Or am I doing something wrong . When I use SM only then is connected is true. is this expected behaviour with SM ?