diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index ddc538e5..c49477f3 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -1381,8 +1381,10 @@ public class XmppConnection implements Runnable { try { socket.close(); } catch (IOException e) { - e.printStackTrace(); + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": io exception "+e.getMessage()+" during force close"); } + } else { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": socket was null during force close"); } } @@ -1407,7 +1409,11 @@ public class XmppConnection implements Runnable { Log.d(Config.LOGTAG, account.getJid().toBareJid()+": waiting for tag writer to finish"); warned = true; } - Thread.sleep(200); + try { + Thread.sleep(200); + } catch(InterruptedException e) { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": sleep interrupted"); + } i++; } if (warned) { @@ -1417,8 +1423,8 @@ public class XmppConnection implements Runnable { tagWriter.writeTag(Tag.end("stream:stream")); } catch (final IOException e) { Log.d(Config.LOGTAG,account.getJid().toBareJid()+": io exception during disconnect ("+e.getMessage()+")"); - } catch (final InterruptedException e) { - Log.d(Config.LOGTAG, "interrupted"); + } finally { + forceCloseSocket(); } } } |