diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp/XmppConnection.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 1cec0c909..9cb852ea9 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -221,7 +221,6 @@ public class XmppConnection implements Runnable { this.account = account; this.wakeLock = service.getPowerManager().newWakeLock( PowerManager.PARTIAL_WAKE_LOCK, account.getJid().toBareJid().toString()); - tagWriter = new TagWriter(); mXmppConnectionService = service; } @@ -263,8 +262,6 @@ public class XmppConnection implements Runnable { try { Socket localSocket; shouldAuthenticate = needsBinding = !account.isOptionSet(Account.OPTION_REGISTER); - tagReader = new XmlReader(wakeLock); - tagWriter = new TagWriter(); this.changeStatus(Account.State.CONNECTING); final boolean useTor = mXmppConnectionService.useTorToConnect() || account.isOnion(); final boolean extended = mXmppConnectionService.showExtendedConnectionOptions(); @@ -482,6 +479,9 @@ public class XmppConnection implements Runnable { throw new InterruptedException(); } this.socket = socket; + tagReader = new XmlReader(wakeLock); + if (tagWriter != null) tagWriter.forceClose(); + tagWriter = new TagWriter(); tagWriter.setOutputStream(socket.getOutputStream()); tagReader.setInputStream(socket.getInputStream()); tagWriter.beginDocument(); @@ -1386,9 +1386,6 @@ public class XmppConnection implements Runnable { } private void forceCloseSocket() { - if (tagWriter != null) { - tagWriter.forceClose(); - } if (socket != null) { try { socket.close(); |