fix(llc): fix connecting while connecting and disconneting (#1237)
* fix(llc): fix connecting while connecting and disconneting * chore(llc): update changelog * chore(llc): add test * chore(llc): improve test * fix(llc): _resetRequestFlags regardless of the connection status
This commit is contained in:
@@ -436,6 +436,9 @@ class WebSocket with TimerHelper {
|
||||
/// Disconnects the WS and releases eventual resources
|
||||
void disconnect() {
|
||||
if (connectionStatus == ConnectionStatus.disconnected) return;
|
||||
|
||||
_resetRequestFlags(resetAttempts: true);
|
||||
|
||||
_connectionStatus = ConnectionStatus.disconnected;
|
||||
|
||||
_logger?.info('Disconnecting web-socket connection');
|
||||
@@ -447,6 +450,7 @@ class WebSocket with TimerHelper {
|
||||
_stopMonitoringEvents();
|
||||
|
||||
_manuallyClosed = true;
|
||||
|
||||
_closeWebSocketChannel();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user