close method
Close the connection
Implementation
@override
void close() {
_logger.debug('Closing AuthenticatedEventSource');
_subscription?.cancel();
try {
_response?.detachSocket().then((socket) {
_logger.debug('Detached authenticated socket - destroying...');
socket.destroy();
});
} catch (e) {
_logger.debug('Error detaching authenticated socket: $e');
}
try {
_request?.abort();
} catch (_) {}
try {
_client?.close(force: true);
} catch (_) {}
_isConnected = false;
}