package okio;

import java.io.IOException;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.util.logging.Level;

/* JADX INFO: loaded from: classes2.dex */
final class D extends C0686d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final Socket f6014a;

    public D(Socket socket) {
        kotlin.jvm.internal.l.e(socket, "socket");
        this.f6014a = socket;
    }

    @Override // okio.C0686d
    protected IOException newTimeoutException(IOException iOException) {
        SocketTimeoutException socketTimeoutException = new SocketTimeoutException("timeout");
        if (iOException != null) {
            socketTimeoutException.initCause(iOException);
        }
        return socketTimeoutException;
    }

    @Override // okio.C0686d
    protected void timedOut() {
        try {
            this.f6014a.close();
        } catch (AssertionError e2) {
            if (!q.e(e2)) {
                throw e2;
            }
            r.f6051a.log(Level.WARNING, "Failed to close timed out socket " + this.f6014a, (Throwable) e2);
        } catch (Exception e3) {
            r.f6051a.log(Level.WARNING, "Failed to close timed out socket " + this.f6014a, (Throwable) e3);
        }
    }
}
