.class public Lra/d;
.super Lka/d;
.source ""


# instance fields
.field public w:Lra/a;

.field public x:Ljava/net/Socket;

.field public y:Lra/c;


# direct methods
.method public constructor <init>()V
    .registers 2

    invoke-direct {p0}, Lka/d;-><init>()V

    const/4 v0, 0x0

    iput-object v0, p0, Lra/d;->w:Lra/a;

    iput-object v0, p0, Lra/d;->x:Ljava/net/Socket;

    iput-object v0, p0, Lra/d;->y:Lra/c;

    return-void
.end method


# virtual methods
.method public b(Lka/a;)V
    .registers 2

    invoke-super {p0, p1}, Lka/d;->b(Lka/a;)V

    check-cast p1, Lra/a;

    iput-object p1, p0, Lra/d;->w:Lra/a;

    .line 1
    iget-object p1, p1, Lka/a;->s:Lka/c;

    .line 2
    check-cast p1, Lra/c;

    iput-object p1, p0, Lra/d;->y:Lra/c;

    return-void
.end method

.method public d()V
    .registers 2

    iget-object v0, p0, Lra/d;->x:Ljava/net/Socket;

    invoke-virtual {p0, v0}, Lra/d;->f(Ljava/net/Socket;)V

    return-void
.end method

.method public e([B)V
    .registers 9

    const/4 v0, 0x0

    const/4 v1, -0x1

    const/4 v2, 0x0

    move v3, v0

    :goto_4
    if-eq v3, v1, :cond_84

    iget-object v4, p0, Lra/d;->y:Lra/c;

    invoke-interface {v4}, Lka/c;->R()I

    move-result v4

    add-int/lit8 v4, v4, 0x1

    if-ge v3, v4, :cond_84

    :try_start_10
    invoke-virtual {p0}, Lra/d;->g()Ljava/net/Socket;

    move-result-object v2

    if-eqz v2, :cond_4c

    invoke-virtual {v2}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;

    move-result-object v4

    iget-object v5, p0, Lra/d;->y:Lra/c;

    invoke-interface {v5}, Lra/c;->Y()Z

    move-result v5

    if-eqz v5, :cond_26

    array-length v5, p1

    invoke-virtual {v2, v5}, Ljava/net/Socket;->setSendBufferSize(I)V

    :cond_26
    invoke-virtual {v4, p1}, Ljava/io/OutputStream;->write([B)V

    iget-object v5, p0, Lra/d;->y:Lra/c;

    invoke-interface {v5}, Lra/c;->E()[B

    move-result-object v5

    if-eqz v5, :cond_37

    array-length v6, v5

    if-lez v6, :cond_37

    invoke-virtual {v4, v5}, Ljava/io/OutputStream;->write([B)V

    :cond_37
    iget-object v4, p0, Lka/d;->r:Lka/a;

    invoke-virtual {v4, v0}, Lka/a;->m(Z)V
    :try_end_3c
    .catch Ljava/io/IOException; {:try_start_10 .. :try_end_3c} :catch_54

    :try_start_3c
    iget-object v3, p0, Lra/d;->y:Lra/c;

    invoke-interface {v3}, Lra/c;->A()Z

    move-result v3

    if-nez v3, :cond_47

    invoke-virtual {p0, v2}, Lra/d;->f(Ljava/net/Socket;)V
    :try_end_47
    .catch Ljava/io/IOException; {:try_start_3c .. :try_end_47} :catch_49

    :cond_47
    move v3, v1

    goto :goto_4

    :catch_49
    move-exception v4

    move v3, v1

    goto :goto_55

    :cond_4c
    :try_start_4c
    new-instance v4, Lja/f;

    const-string v5, "No socket available"

    invoke-direct {v4, v5}, Lja/f;-><init>(Ljava/lang/String;)V

    throw v4
    :try_end_54
    .catch Ljava/io/IOException; {:try_start_4c .. :try_end_54} :catch_54

    :catch_54
    move-exception v4

    :goto_55
    invoke-virtual {v4}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v5

    const-string v6, "software caused connection abort"

    invoke-virtual {v5, v6}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v5

    if-le v5, v1, :cond_6e

    iget-object v3, p0, Lra/d;->y:Lra/c;

    invoke-interface {v3}, Lka/c;->R()I

    move-result v3

    invoke-virtual {p0, v2}, Lra/d;->f(Ljava/net/Socket;)V

    :cond_6e
    add-int/lit8 v3, v3, 0x1

    invoke-virtual {p0, v2}, Lra/d;->f(Ljava/net/Socket;)V

    iget-object v5, p0, Lra/d;->y:Lra/c;

    invoke-interface {v5}, Lka/c;->R()I

    move-result v5

    add-int/lit8 v5, v5, 0x1

    if-ge v3, v5, :cond_7e

    goto :goto_4

    :cond_7e
    new-instance p1, Lja/f;

    invoke-direct {p1, v4}, Lja/f;-><init>(Ljava/lang/Throwable;)V

    throw p1

    :cond_84
    return-void
.end method

.method public f(Ljava/net/Socket;)V
    .registers 6

    if-nez p1, :cond_3

    return-void

    :cond_3
    const/4 v0, 0x0

    :try_start_4
    invoke-virtual {p1}, Ljava/net/Socket;->close()V
    :try_end_7
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_7} :catch_10
    .catchall {:try_start_4 .. :try_end_7} :catchall_e

    iget-object v1, p0, Lra/d;->x:Ljava/net/Socket;

    if-ne p1, v1, :cond_22

    :goto_b
    iput-object v0, p0, Lra/d;->x:Ljava/net/Socket;

    goto :goto_22

    :catchall_e
    move-exception v1

    goto :goto_29

    :catch_10
    move-exception v1

    :try_start_11
    const-string v2, "Socket is closed"

    invoke-virtual {v1}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v2
    :try_end_1b
    .catchall {:try_start_11 .. :try_end_1b} :catchall_e

    if-eqz v2, :cond_23

    iget-object v1, p0, Lra/d;->x:Ljava/net/Socket;

    if-ne p1, v1, :cond_22

    goto :goto_b

    :cond_22
    :goto_22
    return-void

    :cond_23
    :try_start_23
    new-instance v2, Lja/f;

    invoke-direct {v2, v1}, Lja/f;-><init>(Ljava/lang/Throwable;)V

    throw v2
    :try_end_29
    .catchall {:try_start_23 .. :try_end_29} :catchall_e

    :goto_29
    iget-object v2, p0, Lra/d;->x:Ljava/net/Socket;

    if-ne p1, v2, :cond_2f

    iput-object v0, p0, Lra/d;->x:Ljava/net/Socket;

    :cond_2f
    throw v1
.end method

.method public g()Ljava/net/Socket;
    .registers 5

    iget-object v0, p0, Lra/d;->x:Ljava/net/Socket;

    if-eqz v0, :cond_d

    invoke-virtual {v0}, Ljava/net/Socket;->isConnected()Z

    move-result v0

    if-eqz v0, :cond_d

    iget-object v0, p0, Lra/d;->x:Ljava/net/Socket;

    return-object v0

    :cond_d
    :try_start_d
    iget-object v0, p0, Lra/d;->w:Lra/a;

    invoke-virtual {v0}, Lqa/a;->q()Ljava/net/InetAddress;

    move-result-object v0

    iget-object v1, p0, Lka/d;->r:Lka/a;

    .line 1
    iget-object v1, v1, Lka/a;->s:Lka/c;

    .line 2
    invoke-interface {v1}, Lja/b;->F()I

    move-result v1

    iget-object v2, p0, Lra/d;->y:Lra/c;

    invoke-interface {v2}, Lra/c;->A()Z

    move-result v2

    .line 3
    invoke-virtual {p0}, Lra/d;->k()Ljavax/net/SocketFactory;

    move-result-object v3

    invoke-virtual {v3, v0, v1}, Ljavax/net/SocketFactory;->createSocket(Ljava/net/InetAddress;I)Ljava/net/Socket;

    move-result-object v0

    iget-object v1, p0, Lra/d;->y:Lra/c;

    invoke-interface {v1}, Lra/c;->X()Z

    move-result v1

    const/4 v3, 0x1

    if-eqz v1, :cond_3b

    iget-object v1, p0, Lra/d;->y:Lra/c;

    invoke-interface {v1}, Lra/c;->v()I

    move-result v1

    invoke-virtual {v0, v3, v1}, Ljava/net/Socket;->setSoLinger(ZI)V

    :cond_3b
    iget-object v1, p0, Lra/d;->y:Lra/c;

    invoke-interface {v1}, Lra/c;->V()Z

    move-result v1

    if-eqz v1, :cond_46

    invoke-virtual {v0, v2}, Ljava/net/Socket;->setKeepAlive(Z)V

    :cond_46
    iget-object v1, p0, Lra/d;->y:Lra/c;

    invoke-interface {v1}, Lra/c;->w()Z

    move-result v1

    if-eqz v1, :cond_51

    invoke-virtual {v0, v3}, Ljava/net/Socket;->setReuseAddress(Z)V

    .line 4
    :cond_51
    iput-object v0, p0, Lra/d;->x:Ljava/net/Socket;
    :try_end_53
    .catch Ljava/io/IOException; {:try_start_d .. :try_end_53} :catch_54

    return-object v0

    :catch_54
    move-exception v0

    new-instance v1, Lja/f;

    invoke-direct {v1, v0}, Lja/f;-><init>(Ljava/lang/Throwable;)V

    throw v1
.end method

.method public k()Ljavax/net/SocketFactory;
    .registers 2

    invoke-static {}, Ljavax/net/SocketFactory;->getDefault()Ljavax/net/SocketFactory;

    move-result-object v0

    return-object v0
.end method
