Quantcast
Channel: Ignite Realtime: Message List
Viewing all articles
Browse latest Browse all 11412

XMPP socket keep alive

$
0
0

Hi,

 

On Android, I was wondering what the optimal settings are for keeping long-lived TCP connections to our XMPP server. In the MAXS project I noticed that they use a socket factory with SO_KEEPALIVE set to false. But when I try this I eventually receive timeouts on my socket like these:

 

AbstractXMPPConnection﹕ Connection closed with error

    java.net.SocketTimeoutException

            at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)

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

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

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

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

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

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

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

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

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

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

            at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$200(XMPPTCPCon nection.java:896)

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

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

 

When I look with tcpdump, I see that TCP packets are send to the server but nothing is coming back. The client keeps retransmitting because nothing gets ACK'ed. But the server did not send an RST or FIN. Is there anything I could do on the server (CentOS 7) for keeping idle TCP connections?

 

I am using Smack 4.1.0-beta2.

 

Cheers,
Andrej


Viewing all articles
Browse latest Browse all 11412

Trending Articles