98 lines
4.9 KiB
Java
98 lines
4.9 KiB
Java
package com.discord.gateway;
|
|
|
|
import c.d.b.a.a;
|
|
import com.discord.gateway.GatewaySocket;
|
|
import com.discord.utilities.logging.Logger;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
/* compiled from: GatewaySocket.kt */
|
|
public final class GatewaySocket$expeditedHeartbeat$1 extends o implements Function0<Unit> {
|
|
public final /* synthetic */ String $reason;
|
|
public final /* synthetic */ boolean $shouldResetBackoff;
|
|
public final /* synthetic */ long $timeout;
|
|
public final /* synthetic */ GatewaySocket this$0;
|
|
|
|
/* compiled from: GatewaySocket.kt */
|
|
/* renamed from: com.discord.gateway.GatewaySocket$expeditedHeartbeat$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function1<String, Unit> {
|
|
public final /* synthetic */ GatewaySocket$expeditedHeartbeat$1 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(GatewaySocket$expeditedHeartbeat$1 gatewaySocket$expeditedHeartbeat$1) {
|
|
super(1);
|
|
this.this$0 = gatewaySocket$expeditedHeartbeat$1;
|
|
}
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Unit invoke(String str) {
|
|
invoke(str);
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(String str) {
|
|
m.checkNotNullParameter(str, "reason");
|
|
GatewaySocket.Companion companion = GatewaySocket.Companion;
|
|
Logger access$getLogger$p = GatewaySocket.access$getLogger$p(this.this$0.this$0);
|
|
GatewaySocket.Companion.log$default(companion, access$getLogger$p, "Connection backoff reset " + str + '.', false, 2, null);
|
|
GatewaySocket.access$getGatewayBackoff$p(this.this$0.this$0).succeed();
|
|
GatewaySocket.access$setNextReconnectIsImmediate$p(this.this$0.this$0, true);
|
|
if (GatewaySocket.access$getConnectionState$p(this.this$0.this$0) == 1) {
|
|
GatewaySocket.access$discover(this.this$0.this$0);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: GatewaySocket.kt */
|
|
/* renamed from: com.discord.gateway.GatewaySocket$expeditedHeartbeat$1$2 reason: invalid class name */
|
|
public static final class AnonymousClass2 extends o implements Function0<Unit> {
|
|
public final /* synthetic */ GatewaySocket$expeditedHeartbeat$1 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass2(GatewaySocket$expeditedHeartbeat$1 gatewaySocket$expeditedHeartbeat$1) {
|
|
super(0);
|
|
this.this$0 = gatewaySocket$expeditedHeartbeat$1;
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
/* renamed from: invoke */
|
|
public final void mo1invoke() {
|
|
if (!GatewaySocket.access$getHeartbeatAck$p(this.this$0.this$0)) {
|
|
GatewaySocket.access$handleHeartbeatTimeout(this.this$0.this$0);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public GatewaySocket$expeditedHeartbeat$1(GatewaySocket gatewaySocket, String str, long j, boolean z2) {
|
|
super(0);
|
|
this.this$0 = gatewaySocket;
|
|
this.$reason = str;
|
|
this.$timeout = j;
|
|
this.$shouldResetBackoff = z2;
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
/* renamed from: invoke */
|
|
public final void mo1invoke() {
|
|
String C = this.$reason != null ? a.C(a.L("with reason '"), this.$reason, '\'') : "";
|
|
AnonymousClass1 r1 = new AnonymousClass1(this);
|
|
if (GatewaySocket.access$getWebSocket$p(this.this$0) != null) {
|
|
GatewaySocket.Companion companion = GatewaySocket.Companion;
|
|
Logger access$getLogger$p = GatewaySocket.access$getLogger$p(this.this$0);
|
|
GatewaySocket.Companion.log$default(companion, access$getLogger$p, "Performing an expedited heartbeat " + C + '.', false, 2, null);
|
|
GatewaySocket gatewaySocket = this.this$0;
|
|
GatewaySocket.access$heartbeat(gatewaySocket, GatewaySocket.access$getSeq$p(gatewaySocket));
|
|
GatewaySocket.access$setHeartbeatAck$p(this.this$0, false);
|
|
GatewaySocket.access$getHeartbeatExpeditedTimeout$p(this.this$0).schedule(new AnonymousClass2(this), this.$timeout);
|
|
} else if (this.$shouldResetBackoff) {
|
|
r1.invoke(C);
|
|
} else {
|
|
GatewaySocket.Companion.log$default(GatewaySocket.Companion, GatewaySocket.access$getLogger$p(this.this$0), a.u("Expedited heartbeat requested ", C, ", but disconnected and no reset backoff."), false, 2, null);
|
|
}
|
|
}
|
|
}
|