1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

Introduce CloseableUtil

This commit is contained in:
Florian Schmaus 2018-08-15 17:25:22 +02:00
parent 1136e8a2e9
commit a00aa726fe
19 changed files with 109 additions and 256 deletions

View file

@ -125,6 +125,7 @@ import org.jivesoftware.smack.sm.predicates.Predicate;
import org.jivesoftware.smack.sm.provider.ParseStreamManagement;
import org.jivesoftware.smack.util.ArrayBlockingQueueWithShutdown;
import org.jivesoftware.smack.util.Async;
import org.jivesoftware.smack.util.CloseableUtil;
import org.jivesoftware.smack.util.DNSUtil;
import org.jivesoftware.smack.util.PacketParserUtils;
import org.jivesoftware.smack.util.StringUtils;
@ -506,11 +507,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
}
LOGGER.finer("PacketReader has been shut down");
try {
socket.close();
} catch (Exception e) {
LOGGER.log(Level.WARNING, "shutdown", e);
}
CloseableUtil.maybeClose(socket, LOGGER);
setWasAuthenticated();
// If we are able to resume the stream, then don't set