mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-23 02:58:00 +01:00
SMACK-405 Removed redundant code in XMPPConnection.shutdown()
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_1@13690 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
cb5e1dc94b
commit
0f247cf30e
1 changed files with 8 additions and 34 deletions
|
@ -443,48 +443,22 @@ public class XMPPConnection extends Connection {
|
||||||
// Ignore.
|
// Ignore.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set socketClosed to true. This will cause the PacketReader
|
// Set socketClosed to true. This will cause the PacketReader
|
||||||
// and PacketWriter to ingore any Exceptions that are thrown
|
// and PacketWriter to ignore any Exceptions that are thrown
|
||||||
// because of a read/write from/to a closed stream.
|
// because of a read/write from/to a closed stream.
|
||||||
// It is *important* that this is done before socket.close()!
|
// It is *important* that this is done before socket.close()!
|
||||||
socketClosed = true;
|
socketClosed = true;
|
||||||
try {
|
try {
|
||||||
socket.close();
|
socket.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
// In most cases the close() should be successful, so set
|
// In most cases the close() should be successful, so set
|
||||||
// connected to false here.
|
// connected to false here.
|
||||||
connected = false;
|
connected = false;
|
||||||
|
|
||||||
// Close down the readers and writers.
|
reader = null;
|
||||||
if (reader != null) {
|
writer = null;
|
||||||
try {
|
|
||||||
// Should already be closed by the previous
|
|
||||||
// socket.close(). But just in case do it explicitly.
|
|
||||||
reader.close();
|
|
||||||
}
|
|
||||||
catch (Throwable ignore) { /* ignore */ }
|
|
||||||
reader = null;
|
|
||||||
}
|
|
||||||
if (writer != null) {
|
|
||||||
try {
|
|
||||||
// Should already be closed by the previous
|
|
||||||
// socket.close(). But just in case do it explicitly.
|
|
||||||
writer.close();
|
|
||||||
}
|
|
||||||
catch (Throwable ignore) { /* ignore */ }
|
|
||||||
writer = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure that the socket is really closed
|
|
||||||
try {
|
|
||||||
// Does nothing if the socket is already closed
|
|
||||||
socket.close();
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
// Ignore.
|
|
||||||
}
|
|
||||||
|
|
||||||
saslAuthentication.init();
|
saslAuthentication.init();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue