package defpackage;

import j$.util.concurrent.ConcurrentHashMap;
import java.io.Closeable;
import java.io.IOException;

/* JADX INFO: renamed from: ᵘˊ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2563 implements Closeable {

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public static final InterfaceC5025 f9906 = AbstractC2626.m6386(C2563.class);

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public ConcurrentHashMap f9907;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public C3250 f9908;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public C3963 f9909;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public ˈᵷᵵᵞ f9910;

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() {
        InterfaceC5025 interfaceC5025 = f9906;
        interfaceC5025.mo9478();
        for (C5179 c5179 : this.f9907.values()) {
            try {
                c5179.close();
            } catch (Exception e) {
                interfaceC5025.mo9486(c5179.f19495, "Error closing connection to host {}");
                interfaceC5025.mo9492(e);
            }
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C5179 m6288(String str) {
        synchronized (this) {
            try {
                String str2 = str + ":445";
                C5179 c5179 = (C5179) this.f9907.get(str2);
                if (c5179 != null && c5179.f19494.getAndIncrement() <= 0) {
                    c5179 = null;
                }
                if (c5179 != null && c5179.f19490.m10585()) {
                    return c5179;
                }
                C5179 c51792 = new C5179(this.f9909, this, this.f9908);
                try {
                    c51792.m10720(str);
                    this.f9907.put(str2, c51792);
                    return c51792;
                } catch (IOException e) {
                    AutoCloseable[] autoCloseableArr = {c51792};
                    int i = AbstractC1348.f5586;
                    AutoCloseable autoCloseable = autoCloseableArr[0];
                    if (autoCloseable != null) {
                        try {
                            AbstractC0793.m2875(autoCloseable);
                        } catch (Exception unused) {
                        }
                    }
                    throw e;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}
