Class AbstractMediaGatewayConnection
java.lang.Object
moe.kyokobot.koe.internal.gateway.AbstractMediaGatewayConnection
- All Implemented Interfaces:
MediaGatewayConnection
- Direct Known Subclasses:
MediaGatewayV4Connection,MediaGatewayV5Connection,MediaGatewayV8Connection
public abstract class AbstractMediaGatewayConnection
extends Object
implements MediaGatewayConnection
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.netty.buffer.ByteBufAllocatorprotected final io.netty.bootstrap.Bootstrapprotected io.netty.channel.Channelprotected intprotected CompletableFuture<Void>protected final MediaConnectionImplprotected io.netty.util.concurrent.EventExecutorprotected booleanprotected final io.netty.handler.ssl.SslContextprotected final VoiceServerInfoprotected final URI -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMediaGatewayConnection(MediaConnectionImpl connection, VoiceServerInfo voiceServerInfo, int version) -
Method Summary
Modifier and TypeMethodDescriptionvoidgetValve()protected abstract voidhandlePayload(io.netty.buffer.ByteBuf byteBuf) protected abstract voidhandlePayload(JsonObject object) protected abstract voididentify()booleanisOpen()protected voidvoidprotected abstract voidresume()voidsendInternalBinPayload(int op, byte[] d) voidsendInternalPayload(int op, Object d) protected voidsendRaw(JsonObject object) protected voidsendRawBin(io.netty.buffer.ByteBuf buffer) start()protected static StringstripPort80(String endpoint) abstract voidupdateSpeaking(int mask) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface moe.kyokobot.koe.gateway.MediaGatewayConnection
getPing, sendMLSCommitWelcome, sendMLSInvalidCommitWelcome, sendMLSKeyPackage, sendSecureFramesReadyForTransition
-
Field Details
-
connection
-
voiceServerInfo
-
websocketURI
-
bootstrap
protected final io.netty.bootstrap.Bootstrap bootstrap -
sslContext
protected final io.netty.handler.ssl.SslContext sslContext -
allocator
protected final io.netty.buffer.ByteBufAllocator allocator -
connectFuture
-
eventExecutor
protected io.netty.util.concurrent.EventExecutor eventExecutor -
channel
protected io.netty.channel.Channel channel -
connectAttempt
protected int connectAttempt -
resumable
protected boolean resumable
-
-
Constructor Details
-
AbstractMediaGatewayConnection
public AbstractMediaGatewayConnection(@NotNull MediaConnectionImpl connection, @NotNull VoiceServerInfo voiceServerInfo, int version)
-
-
Method Details
-
getValve
- Specified by:
getValvein interfaceMediaGatewayConnection- Returns:
- The
MediaValveused by this connection, or null if this gateway version does not support it.
-
start
- Specified by:
startin interfaceMediaGatewayConnection
-
close
- Specified by:
closein interfaceMediaGatewayConnection
-
reconnect
public void reconnect()- Specified by:
reconnectin interfaceMediaGatewayConnection
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceMediaGatewayConnection
-
identify
protected abstract void identify() -
resume
protected abstract void resume() -
handlePayload
-
handlePayload
protected abstract void handlePayload(io.netty.buffer.ByteBuf byteBuf) -
onClose
-
updateSpeaking
public abstract void updateSpeaking(int mask) - Specified by:
updateSpeakingin interfaceMediaGatewayConnection
-
sendInternalPayload
-
sendInternalBinPayload
public void sendInternalBinPayload(int op, byte[] d) -
sendRaw
-
sendRawBin
protected void sendRawBin(io.netty.buffer.ByteBuf buffer) -
stripPort80
-