mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-08 06:01:07 +01:00
Gracefully disconnect XMPPTCPConnection
That is, wait with a timeout for a closing stream element if we have sent a closing stream element to the server. See RFC 6120 § 4.4. Fixes SMACK-633.
This commit is contained in:
parent
01f08e87c2
commit
8840236b72
4 changed files with 127 additions and 16 deletions
|
|
@ -75,6 +75,17 @@ public class IntTestUtil {
|
|||
|
||||
public static void disconnectAndMaybeDelete(XMPPTCPConnection connection, boolean delete)
|
||||
throws InterruptedException {
|
||||
// If the connection is disconnected, then re-reconnect and login. This could happen when
|
||||
// (low-level) integration tests disconnect the connection, e.g. to test disconnection
|
||||
// mechanisms
|
||||
if (!connection.isConnected()) {
|
||||
try {
|
||||
connection.connect().login();
|
||||
}
|
||||
catch (XMPPException | SmackException | IOException e) {
|
||||
LOGGER.log(Level.WARNING, "Exception reconnection account for deletion", e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (delete) {
|
||||
final int maxAttempts = 3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue