aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xmpp
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-12 22:31:50 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-12 22:31:50 +0100
commiteadebeb77cbc4f5b49d484b8a64058630385afe6 (patch)
tree5a5150b25d274b2e4bdce2b643792f69e7f4be38 /src/eu/siacs/conversations/xmpp
parentc67238562ae2228efbe96225b23b2a297aea8f2f (diff)
added server info and deal with thi 'connecting...' bug
Diffstat (limited to 'src/eu/siacs/conversations/xmpp')
-rw-r--r--src/eu/siacs/conversations/xmpp/XmppConnection.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java
index 00a37b76c..277878cae 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;
+ }
}