BaseSocketTimeOutProcessor.smali

.class public abstract Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;
.super Ljava/lang/Object;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor$TimeOutRunnable;
    }
.end annotation


# instance fields
.field private mTimeOutHandler:Landroid/os/Handler;

.field private mTimeOutRunnables:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt",
            "<",
            "Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor$TimeOutRunnable;",
            ">;"
        }
    .end annotation
.end field


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

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

    new-instance v0, Landroid/os/Handler;

    invoke-direct {v0}, Landroid/os/Handler;-><init>()V

    iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutHandler:Landroid/os/Handler;

    new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;

    invoke-direct {v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;-><init>()V

    iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutRunnables:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;

    return-void
.end method

.method static synthetic access$000(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;)Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutRunnables:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;

    return-object v0
.end method


# virtual methods
.method public deployRecvAckTimeOut(I)V
    .registers 6

    new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor$TimeOutRunnable;

    invoke-direct {v0, p0, p1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor$TimeOutRunnable;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;I)V

    iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutHandler:Landroid/os/Handler;

    sget-wide v2, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocketCommon;->ACCEPT_ACK_TIME_OUT_THRESHOLD:J

    invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutRunnables:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;

    invoke-virtual {v1, p1, v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;->put(ILjava/lang/Object;)V

    return-void
.end method

.method public destroy()V
    .registers 3

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutRunnables:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;

    invoke-virtual {v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;->clear()V

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutHandler:Landroid/os/Handler;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacksAndMessages(Ljava/lang/Object;)V

    return-void
.end method

.method public abstract onTimeOut(I)V
.end method

.method public removeAckTimeOut(I)V
    .registers 4

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutRunnables:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;

    invoke-virtual {v0, p1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/SparseArrayExt;->poll(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor$TimeOutRunnable;

    if-eqz v0, :cond_f

    iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/BaseSocketTimeOutProcessor;->mTimeOutHandler:Landroid/os/Handler;

    invoke-virtual {v1, v0}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V

    :cond_f
    return-void
.end method