package x7;

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

/* JADX INFO: loaded from: classes.dex */
public final class G extends C1728d {

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final Socket f18739m;

    public G(Socket socket) {
        this.f18739m = socket;
    }

    @Override // x7.C1728d
    public final void j() {
        Socket socket = this.f18739m;
        try {
            socket.close();
        } catch (AssertionError e8) {
            if (!s7.l.q(e8)) {
                throw e8;
            }
            v.f18794a.log(Level.WARNING, "Failed to close timed out socket " + socket, (Throwable) e8);
        } catch (Exception e9) {
            v.f18794a.log(Level.WARNING, "Failed to close timed out socket " + socket, (Throwable) e9);
        }
    }

    public final IOException k(IOException iOException) {
        SocketTimeoutException socketTimeoutException = new SocketTimeoutException("timeout");
        if (iOException != null) {
            socketTimeoutException.initCause(iOException);
        }
        return socketTimeoutException;
    }
}
