From eadebeb77cbc4f5b49d484b8a64058630385afe6 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 12 Mar 2014 22:31:50 +0100 Subject: added server info and deal with thi 'connecting...' bug --- src/eu/siacs/conversations/xmpp/XmppConnection.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/eu/siacs/conversations/xmpp') diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java index 00a37b76..277878ca 100644 --- a/src/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java @@ -74,6 +74,8 @@ public class XmppConnection implements Runnable { public long lastPaketReceived = 0; public long lastPingSent = 0; + public long lastConnect = 0; + public long lastSessionStarted = 0; private static final int PACKET_IQ = 0; private static final int PACKET_MESSAGE = 1; @@ -105,6 +107,7 @@ public class XmppConnection implements Runnable { protected void connect() { Log.d(LOGTAG,account.getJid()+ ": connecting"); + lastConnect = SystemClock.elapsedRealtime(); try { tagReader = new XmlReader(wakeLock); tagWriter = new TagWriter(); @@ -204,6 +207,7 @@ public class XmppConnection implements Runnable { } else { Log.d(LOGTAG,account.getJid()+": stream managment enabled"); } + this.lastSessionStarted = SystemClock.elapsedRealtime(); this.stanzasReceived = 0; RequestPacket r = new RequestPacket(); tagWriter.writeStanzaAsync(r); @@ -647,10 +651,11 @@ public class XmppConnection implements Runnable { try { if (force) { socket.close(); + return; } tagWriter.finish(); while(!tagWriter.finished()) { - Log.d(LOGTAG,"not yet finished"); + //Log.d(LOGTAG,"not yet finished"); Thread.sleep(100); } tagWriter.writeTag(Tag.end("stream:stream")); @@ -672,4 +677,12 @@ public class XmppConnection implements Runnable { public void r() { this.tagWriter.writeStanzaAsync(new RequestPacket()); } + + public int getReceivedStanzas() { + return this.stanzasReceived; + } + + public int getSentStanzas() { + return this.stanzasSent; + } } -- cgit v1.2.3