package defpackage;

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

/* renamed from: ᵷᵝˉ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4903 implements Closeable {

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public static final InterfaceC0567 f18252 = AbstractC1385.m4255(C4903.class);

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public C3900 f18253;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public ConcurrentHashMap f18254;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public ˑᵽʾʦ f18255;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public C3174 f18256;

    @Override // java.io.Closeable, java.lang.AutoCloseable
    public final void close() {
        InterfaceC0567 interfaceC0567 = f18252;
        interfaceC0567.mo2403();
        for (C3500 c3500 : this.f18254.values()) {
            try {
                c3500.close();
            } catch (Exception e) {
                interfaceC0567.mo2409(c3500.f13109, "Error closing connection to host {}");
                interfaceC0567.mo2397(e);
            }
        }
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C3500 m10350(String str) {
        synchronized (this) {
            try {
                String str2 = str + ":445";
                C3500 c3500 = (C3500) this.f18254.get(str2);
                if (c3500 != null && c3500.f13114.getAndIncrement() <= 0) {
                    c3500 = null;
                }
                if (c3500 != null && c3500.f13115.m10505()) {
                    return c3500;
                }
                C3500 c35002 = new C3500(this.f18253, this, this.f18256);
                try {
                    c35002.m7978(str);
                    this.f18254.put(str2, c35002);
                    return c35002;
                } catch (IOException e) {
                    AutoCloseable[] autoCloseableArr = {c35002};
                    int i = AbstractC0158.f1559;
                    AutoCloseable autoCloseable = autoCloseableArr[0];
                    if (autoCloseable != null) {
                        try {
                            AbstractC3915.m8587(autoCloseable);
                        } catch (Exception unused) {
                        }
                    }
                    throw e;
                }
            } catch (Throwable th) {
                throw th;
            }
        }
    }
}
