.class final Lcom/a/a/bf;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic a:Ljava/net/InetAddress;

.field final synthetic b:I

.field final synthetic c:Lcom/a/a/a/f;

.field final synthetic d:Lcom/a/a/i;

.field final synthetic e:Lcom/a/a/e;


# direct methods
.method constructor <init>(Lcom/a/a/e;Ljava/net/InetAddress;ILcom/a/a/a/f;Lcom/a/a/i;)V
    .locals 0

    iput-object p1, p0, Lcom/a/a/bf;->e:Lcom/a/a/e;

    iput-object p2, p0, Lcom/a/a/bf;->a:Ljava/net/InetAddress;

    iput p3, p0, Lcom/a/a/bf;->b:I

    iput-object p4, p0, Lcom/a/a/bf;->c:Lcom/a/a/a/f;

    iput-object p5, p0, Lcom/a/a/bf;->d:Lcom/a/a/i;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public final run()V
    .locals 7

    const/4 v0, 0x0

    :try_start_0
    invoke-static {}, Ljava/nio/channels/ServerSocketChannel;->open()Ljava/nio/channels/ServerSocketChannel;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    move-result-object v1

    :try_start_1
    new-instance v2, Lcom/a/a/aw;

    invoke-direct {v2, v1}, Lcom/a/a/aw;-><init>(Ljava/nio/channels/ServerSocketChannel;)V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2

    :try_start_2
    iget-object v0, p0, Lcom/a/a/bf;->a:Ljava/net/InetAddress;

    if-nez v0, :cond_0

    new-instance v0, Ljava/net/InetSocketAddress;

    iget v3, p0, Lcom/a/a/bf;->b:I

    invoke-direct {v0, v3}, Ljava/net/InetSocketAddress;-><init>(I)V

    :goto_0
    invoke-virtual {v1}, Ljava/nio/channels/ServerSocketChannel;->socket()Ljava/net/ServerSocket;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/net/ServerSocket;->bind(Ljava/net/SocketAddress;)V

    iget-object v0, p0, Lcom/a/a/bf;->e:Lcom/a/a/e;

    invoke-static {v0}, Lcom/a/a/e;->a(Lcom/a/a/e;)Lcom/a/a/af;

    move-result-object v0

    invoke-virtual {v0}, Lcom/a/a/af;->b()Ljava/nio/channels/Selector;

    move-result-object v0

    invoke-virtual {v2, v0}, Lcom/a/a/aw;->a(Ljava/nio/channels/Selector;)Ljava/nio/channels/SelectionKey;

    move-result-object v3

    iget-object v0, p0, Lcom/a/a/bf;->c:Lcom/a/a/a/f;

    invoke-virtual {v3, v0}, Ljava/nio/channels/SelectionKey;->attach(Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v4, p0, Lcom/a/a/bf;->c:Lcom/a/a/a/f;

    iget-object v5, p0, Lcom/a/a/bf;->d:Lcom/a/a/i;

    new-instance v0, Lcom/a/a/bg;

    invoke-direct {v0, p0, v1, v2, v3}, Lcom/a/a/bg;-><init>(Lcom/a/a/bf;Ljava/nio/channels/ServerSocketChannel;Lcom/a/a/aw;Ljava/nio/channels/SelectionKey;)V

    iput-object v0, v5, Lcom/a/a/i;->a:Ljava/lang/Object;

    check-cast v0, Lcom/a/a/l;

    invoke-interface {v4, v0}, Lcom/a/a/a/f;->a(Lcom/a/a/l;)V

    :goto_1
    return-void

    :cond_0
    new-instance v0, Ljava/net/InetSocketAddress;

    iget-object v3, p0, Lcom/a/a/bf;->a:Ljava/net/InetAddress;

    iget v4, p0, Lcom/a/a/bf;->b:I

    invoke-direct {v0, v3, v4}, Ljava/net/InetSocketAddress;-><init>(Ljava/net/InetAddress;I)V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    move-object v6, v1

    move-object v1, v2

    move-object v2, v0

    move-object v0, v6

    :goto_2
    const/4 v3, 0x2

    new-array v3, v3, [Ljava/io/Closeable;

    const/4 v4, 0x0

    aput-object v1, v3, v4

    const/4 v1, 0x1

    aput-object v0, v3, v1

    invoke-static {v3}, Lcom/a/a/e/c;->a([Ljava/io/Closeable;)V

    iget-object v0, p0, Lcom/a/a/bf;->c:Lcom/a/a/a/f;

    invoke-interface {v0, v2}, Lcom/a/a/a/f;->a_(Ljava/lang/Exception;)V

    goto :goto_1

    :catch_1
    move-exception v1

    move-object v2, v1

    move-object v1, v0

    goto :goto_2

    :catch_2
    move-exception v2

    move-object v6, v1

    move-object v1, v0

    move-object v0, v6

    goto :goto_2
.end method
