diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index b242cd568..4ee5a6a4e 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1517,9 +1517,7 @@ public class XmppConnection implements Runnable { final Socket currentSocket = this.socket; final CountDownLatch streamCountDownLatch = this.mStreamCountDownLatch; try { - for (int i = 0; i <= 10 && !currentTagWriter.finished() && !currentSocket.isClosed(); ++i) { - Thread.sleep(100); - } + currentTagWriter.await(1, TimeUnit.SECONDS); Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": closing stream"); currentTagWriter.writeTag(Tag.end("stream:stream")); if (streamCountDownLatch != null) { @@ -1542,14 +1540,6 @@ public class XmppConnection implements Runnable { } } - private static void uninterruptedSleep(int time) { - try { - Thread.sleep(time); - } catch (InterruptedException e) { - //ignore - } - } - public void resetStreamId() { this.streamId = null; } |