[ejabberd] With SMACK, ejabberd closed connection error on client side

Gaurav Jain monkeyfdude at gmail.com
Sat Sep 19 04:55:50 MSK 2015


I am trying to use `smack-4.1` with `ejabberd-15.x`. But after few (1-2)
minutes of idle client, when I try to send message, I get SMACK error
"server closed the connection" on the client side

* I run ejabberd **WITH OUT** `mod_ping`

What is the ejabberd config to prevent idle client disconnects?




> org.jivesoftware.smack.SmackException: Parser got END_DOCUMENT event.
> This could happen e.g. if the server closed the connection without
> sending a closing stream element


* Smack config on client (Android)

            config = XMPPTCPConnectionConfiguration.builder()
                    .setHost(serverConfig.xmppServer())
                    .setServiceName(serverConfig.xmppServiceName())
                    .setUsernameAndPassword(accountID, password)
                    .setSendPresence(true)

.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
                    .setCompressionEnabled(false).build();

            this.xmppConnection = new XMPPTCPConnection(config);
            this.xmppConnection.addConnectionListener(this);
            this.xmppConnection.addAsyncStanzaListener(new
XMPPStanzaListener(), new XMPPStanzaFilter());
            this.xmppConnection.setUseStreamManagement(true);
            this.xmppConnection.setUseStreamManagementResumption(true);


Would you be able to tell appropriate configs for both

* ejabberd and
* smack 4.1

to avoid the above mentioned issue?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20150918/b374cf4d/attachment.html>


More information about the ejabberd mailing list