AnsweredAssumed Answered

</stream:stream> causes SocketTimeoutException

Question asked by Jeffrey Ma on Nov 3, 2014
Latest reply on Nov 21, 2014 by Flow

Hi,

 

I have observed that my android app sometimes sends </stream:stream> to server which causes SocketTimeoutException, does anyone have any ideas what might causes this? I am currently using asmack-android-8-4.0.5 for development. Thanks.

 

 

11-02 10:27:36.475: D/SMACK(13017): SENT (0): <stream:stream to="server" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">

11-02 10:27:36.555: D/SMACK(13017): RCV (0): <?xml version='1.0' encoding='UTF-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="server" id="8e1fcec" xml:lang="en" version="1.0">

11-02 10:27:36.635: D/SMACK(13017): RCV (0): <stream:features><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"></starttls><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>DIGEST-MD5</mechanism><mech anism>PLAIN</mechanism><mechanism>CRAM-MD5</mechanism></mechanisms><compression xmlns="http://jabber.org/features/compress"><method>zlib</method></compression><auth xmlns="http://jabber.org/features/iq-auth"/><register xmlns="http://jabber.org/features/iq-register"/></stream:features>

...

...

11-02 10:27:37.165: D/SMACK(13017): RCV (0): <presence id="x5I03-48" from=“jid@server/Smack" to="jid@server/Smack”/>

11-02 10:40:37.165: D/SMACK(13017): SENT (0): </stream:stream>

11-02 10:40:37.175: W/XMPPConnection(13017): Connection closed with error

11-02 10:40:37.175: W/XMPPConnection(13017): java.net.SocketTimeoutException

11-02 10:40:37.175: W/XMPPConnection(13017): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:491)

11-02 10:40:37.175: W/XMPPConnection(13017): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)

11-02 10:40:37.175: W/XMPPConnection(13017): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)

11-02 10:40:37.175: W/XMPPConnection(13017): at java.io.InputStreamReader.read(InputStreamReader.java:233)

11-02 10:40:37.175: W/XMPPConnection(13017): at java.io.BufferedReader.read(BufferedReader.java:325)

11-02 10:40:37.175: W/XMPPConnection(13017): at org.jivesoftware.smack.util.ObservableReader.read(ObservableReader.java:38)

11-02 10:40:37.175: W/XMPPConnection(13017): at org.kxml2.io.KXmlParser.fillBuffer(KXmlParser.java:1506)

11-02 10:40:37.175: W/XMPPConnection(13017): at org.kxml2.io.KXmlParser.peekType(KXmlParser.java:986)

11-02 10:40:37.175: W/XMPPConnection(13017): at org.kxml2.io.KXmlParser.next(KXmlParser.java:346)

11-02 10:40:37.175: W/XMPPConnection(13017): at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)

11-02 10:40:37.175: W/XMPPConnection(13017): at org.jivesoftware.smack.tcp.PacketReader.parsePackets(PacketReader.java:291)

11-02 10:40:37.175: W/XMPPConnection(13017): at org.jivesoftware.smack.tcp.PacketReader.access$000(PacketReader.java:47)

11-02 10:40:37.175: W/XMPPConnection(13017): at org.jivesoftware.smack.tcp.PacketReader$1.run(PacketReader.java:81)

Outcomes