close method Null safety

Future<void> close()

Implementation

Future<void> close() async {
	if (reconnectTimer != null && reconnectTimer!.isActive) reconnectTimer!.cancel();
	if (_queriesTimer != null) {
		_queriesTimer!.cancel();
		_queriesTimer = null;
	}
	_handlers.clear();
	_applyReconnect = false;
	if (_socketInitialized) await socket.close();
}