2

I tried enabling stream management(XEP-0198) by this piece of code

XMPPTCPConnectionConfiguration connConfig = XMPPTCPConnectionConfiguration.builder().setHost(HOST)
            .setPort(PORT).setDebuggerEnabled(true).setSecurityMode(SecurityMode.disabled)
            .setUsernameAndPassword(USERNAME, PASSWORD).setServiceName(SERVICE).build();

    XMPPTCPConnectionconnection = new XMPPTCPConnection(connConfig);

        connection.setPacketReplyTimeout(TIME_OUT);
        connection.connect();
        connection.login();
        connection.setUseStreamManagement(true);

But later when I check for stream management it returns false.

Flow
  • 23,572
  • 15
  • 99
  • 156

1 Answers1

5

I guess you need to set stream management before connecting to xmpp.

XMPPTCPConnectionConfiguration connConfig = XMPPTCPConnectionConfiguration.builder().setHost(HOST)
        .setPort(PORT).setDebuggerEnabled(true).setSecurityMode(SecurityMode.disabled)
        .setUsernameAndPassword(USERNAME, PASSWORD).setServiceName(SERVICE).build();

XMPPTCPConnectionconnection = new XMPPTCPConnection(connConfig);

    connection.setUseStreamManagement(true);
    connection.setPacketReplyTimeout(TIME_OUT);
    connection.connect();
    connection.login();
Anand Prakash
  • 381
  • 2
  • 9
  • can you look at this question- http://stackoverflow.com/questions/31331329/not-able-to-get-lastactivity-of-a-jabberid –  Jul 10 '15 at 02:06