return if calling disconnect more than once in websocket
This commit is contained in:
@@ -290,6 +290,9 @@ class WebSocket {
|
||||
|
||||
/// Disconnects the WS and releases eventual resources
|
||||
Future<void> disconnect() {
|
||||
if (_manuallyClosed) {
|
||||
return Future.value();
|
||||
}
|
||||
logger.info('disconnecting');
|
||||
_connectionCompleter = Completer();
|
||||
_cancelTimers();
|
||||
|
||||
Reference in New Issue
Block a user