开发专用 v00.00.26版本的 MD5 值为:27d23588b440d1fe24ff30607dd0eda9

以下内容为反编译后的 a.java 源代码,内容仅作参考


package com.deepe.c.l;

import android.support.v4.view.PointerIconCompat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

public abstract class a extends c {
    private boolean a;
    private boolean b;
    private ScheduledExecutorService c;
    private ScheduledFuture<?> d;
    private long e = TimeUnit.SECONDS.toNanos(60);
    private boolean f = false;
    private final Object g = new Object();

    private void a() {
        b();
        this.c = Executors.newSingleThreadScheduledExecutor(new com.deepe.c.l.i.d("connectionLostChecker"));
        Runnable runnable = new Runnable() {
            private ArrayList<b> b = new ArrayList<>();

            @Override
            public void run() {
                long j;
                this.b.clear();
                try {
                    this.b.addAll(a.this.f());
                    synchronized (a.this.g) {
                        double nanoTime = System.nanoTime();
                        double d = a.this.e;
                        Double.isNaN(d);
                        Double.isNaN(nanoTime);
                        j = (long) (nanoTime - (d * 1.5d));
                    }
                    Iterator<b> it = this.b.iterator();
                    while (it.hasNext()) {
                        a.this.a(it.next(), j);
                    }
                } catch (Exception unused) {
                }
                this.b.clear();
            }
        };
        ScheduledExecutorService scheduledExecutorService = this.c;
        long j = this.e;
        this.d = scheduledExecutorService.scheduleAtFixedRate(runnable, j, j, TimeUnit.NANOSECONDS);
    }

    public void a(b bVar, long j) {
        if (bVar instanceof d) {
            d dVar = (d) bVar;
            if (dVar.g() < j) {
                dVar.b(PointerIconCompat.TYPE_CELL, "The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-connection-detection");
            } else if (dVar.c()) {
                dVar.b();
            }
        }
    }

    private void b() {
        ScheduledExecutorService scheduledExecutorService = this.c;
        if (scheduledExecutorService != null) {
            scheduledExecutorService.shutdownNow();
            this.c = null;
        }
        ScheduledFuture<?> scheduledFuture = this.d;
        if (scheduledFuture != null) {
            scheduledFuture.cancel(false);
            this.d = null;
        }
    }

    public void a(boolean z) {
        this.a = z;
    }

    public void b(boolean z) {
        this.b = z;
    }

    public void d() {
        synchronized (this.g) {
            if (this.c != null || this.d != null) {
                this.f = false;
                b();
            }
        }
    }

    public void e() {
        synchronized (this.g) {
            if (this.e <= 0) {
                return;
            }
            this.f = true;
            a();
        }
    }

    protected abstract Collection<b> f();

    public boolean g() {
        return this.a;
    }

    public boolean h() {
        return this.b;
    }
}