bart3
August 5, 2015, 1:46pm
1
Hi, when I’m setting presence, i get a NotConnectedException, while i don’t see a disconnect and the new presence seems to be sent.
try {
_connection.sendStanza(_presence);
} catch (SmackException.NotConnectedException e) {
Log.e(TAG, “setPresence() failed: Not connected”);
e.printStackTrace();
}
bart3
August 5, 2015, 1:49pm
2
Wow it’s quite hard to send a post… It first lost my text and then suddenly posted incomplete text.
Anyway, i added more info:
Here is the log:
08-05 15:22:49.854 E/nl.dobots.imbusy.XmppThread( 9483): Not connected
08-05 15:22:49.854 W/System.err( 9483): org.jivesoftware.smack.SmackException$NotConnectedException: Client is not, or no longer, connected
08-05 15:22:49.854 W/System.err( 9483): at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketWriter.throwNotConnectedExce ptionIfDoneAndResumptionNotPossible(XMPPTCPConnection.java:1230)
08-05 15:22:49.854 W/System.err( 9483): at org.jivesoftware.smack.tcp.XMPPTCPConnection.throwNotConnectedExceptionIfApprop riate(XMPPTCPConnection.java:336)
08-05 15:22:49.854 W/System.err( 9483): at org.jivesoftware.smack.AbstractXMPPConnection.sendStanza(AbstractXMPPConnection .java:614)
08-05 15:22:49.855 W/System.err( 9483): at nl.dobots.imbusy.XmppThread.setPresence(XmppThread.java:190)
08-05 15:22:49.855 W/System.err( 9483): at nl.dobots.imbusy.XmppThread.access$100(XmppThread.java:25)
08-05 15:22:49.855 W/System.err( 9483): at nl.dobots.imbusy.XmppThread$MessageHandler.handleMessage(XmppThread.java:81)
08-05 15:22:49.855 W/System.err( 9483): at android.os.Handler.dispatchMessage(Handler.java:102)
08-05 15:22:49.855 W/System.err( 9483): at android.os.Looper.loop(Looper.java:135)
08-05 15:22:49.855 W/System.err( 9483): at android.os.HandlerThread.run(HandlerThread.java:61)
08-05 15:22:08.277 D/SMACK ( 9483): RECV (1): dnd
bart3
August 6, 2015, 7:10am
4
Yes i do, but someone must’ve changed the presence, and that could’ve been only that code, i think.
Flow
August 6, 2015, 7:48am
5
Possible. Hard to tell without more information. Please show more debug log context, and elaborate what you mean with “i don’t see a disconnect”. Do you install a ConnectionListener that acts on connectionClosedOnError(Exception)?
bart3
August 6, 2015, 8:40am
6
Was planning to do exactly that On pidgin i didn’t see it disconnect, but mostly i was amazed that the presence was still sent out.
So I now added the listener and of course now i’m unable to reproduce the error…
Will post again if i’m able to, thanks.