xmpp: Expect socket closure on reconnection
This commit is contained in:
parent
236de4c37f
commit
ee2ca8d444
@ -334,7 +334,15 @@ class XmppConnection {
|
||||
/// Attempts to reconnect to the server by following an exponential backoff.
|
||||
void _attemptReconnection() {
|
||||
_setConnectionState(XmppConnectionState.notConnected);
|
||||
|
||||
// Prevent the reconnection triggering another reconnection
|
||||
_expectSocketClosure = true;
|
||||
_socket.close();
|
||||
|
||||
// Reset the state
|
||||
_expectSocketClosure = false;
|
||||
|
||||
// Connect again
|
||||
connect();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user