</stream:stream> causes SocketTimeoutException

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:featuresDIGEST-MD5PLAINCRAM-MD5zlib</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)

app sometimes sends </stream:stream> to server which causes SocketTimeoutException

It’s actually the other way around, the SocketTimeoutException causes Smack to send the stream end tag.

I am also facing with same issue.

11-21 10:59:05.670: D/SMACK(712): RCV (0):

11-21 10:59:05.675: D/SMACK(712): SENT (0):

11-21 10:59:07.001: D/SMACK(712): RCV (0):

11-21 10:59:07.004: D/SMACK(712): SENT (0):

11-21 10:59:09.149: D/SMACK(712): RCV (0):

11-21 10:59:09.153: D/SMACK(712): SENT (0):

11-21 10:59:09.231: D/SMACK(712): RCV (0): </stream:stream>

11-21 10:59:09.233: D/SMACK(712): SENT (0):

11-21 10:59:09.234: D/SMACK(712): SENT (0): </stream:stream>

11-21 10:59:09.242: D/SMACK(712): Connection closed (0)

How’s that the same issue? You receive a closing stream element from the server, whereas OPs connection get’s closed by a SocketTimeoutException.

Ok flow if its different issue then whats the solution for this problem or where am i going wrong

11-21 10:59:09.231: D/SMACK(712): RCV (0): </stream:stream>

11-21 10:59:09.233: D/SMACK(712): SENT (0):

11-21 10:59:09.234: D/SMACK(712): SENT (0): </stream:stream>

The server sends a closing stream element, on which Smack also closes the connection. You have to “ask” the server why it does that.