close socket after failed stream open

This commit is contained in:
Daniel Gultsch 2016-11-19 12:20:31 +01:00
parent 3bf2876e09
commit 8132480b82

View File

@ -396,8 +396,11 @@ public class XmppConnection implements Runnable {
throw new SecurityException();
}
}
if (startXmpp(localSocket))
if (startXmpp(localSocket)) {
break; // successfully connected to server that speaks xmpp
} else {
localSocket.close();
}
} catch (final SecurityException e) {
throw e;
} catch (InterruptedException e) {