public class RakSessionCodec
extends io.netty.channel.ChannelDuplexHandler
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
| Constructor and Description |
|---|
RakSessionCodec(RakChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg) |
void |
close(org.cloudburstmc.netty.channel.TransportDisconnectReason reason) |
void |
disconnect()
Sends a disconnect notification to the peer, then closes the channel.
|
void |
disconnect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
disconnect(org.cloudburstmc.netty.channel.TransportDisconnectReason reason)
Like
disconnect(), but fires reason as a user event before closing. |
void |
flush(io.netty.channel.ChannelHandlerContext ctx) |
protected java.util.Queue<IntRange> |
getAcknowledgeQueue(boolean nack) |
io.netty.channel.Channel |
getChannel() |
int |
getMaxMessageSize()
Largest message the session can write, what
RakConstants.MAXIMUM_SPLIT_COUNT parts carry at its MTU. |
RakChannelMetrics |
getMetrics() |
int |
getMtu() |
long |
getPing() |
java.net.InetSocketAddress |
getRemoteAddress() |
double |
getRTT() |
boolean |
isClosed() |
boolean |
isStale() |
boolean |
isStale(long curTime) |
boolean |
isTimedOut() |
boolean |
isTimedOut(long curTime) |
static int |
maxMessageSize(int mtu)
Largest message a session can write at an MTU less the UDP and IP headers, as
getMtu() reports it. |
void |
recalculatePongTime(long pingTime) |
void |
write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise) |
bind, close, connect, deregister, readchannelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic static final java.lang.String NAME
public RakSessionCodec(RakChannel channel)
public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelActive in interface io.netty.channel.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void write(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg,
io.netty.channel.ChannelPromise promise)
write in interface io.netty.channel.ChannelOutboundHandlerwrite in class io.netty.channel.ChannelDuplexHandlerpublic void flush(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
flush in interface io.netty.channel.ChannelOutboundHandlerflush in class io.netty.channel.ChannelDuplexHandlerjava.lang.Exceptionpublic void channelRead(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg)
throws java.lang.Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void disconnect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise)
throws java.lang.Exception
disconnect in interface io.netty.channel.ChannelOutboundHandlerdisconnect in class io.netty.channel.ChannelDuplexHandlerjava.lang.Exceptionpublic void disconnect()
TransportDisconnectReason,
as the caller already knows why it disconnects. ChannelOutboundInvoker.disconnect() behaves the same.public void disconnect(org.cloudburstmc.netty.channel.TransportDisconnectReason reason)
disconnect(), but fires reason as a user event before closing.public void close(org.cloudburstmc.netty.channel.TransportDisconnectReason reason)
public boolean isClosed()
public void recalculatePongTime(long pingTime)
public boolean isStale(long curTime)
public boolean isStale()
public boolean isTimedOut(long curTime)
public boolean isTimedOut()
public long getPing()
public double getRTT()
public int getMtu()
public int getMaxMessageSize()
RakConstants.MAXIMUM_SPLIT_COUNT parts carry at its MTU.public static int maxMessageSize(int mtu)
getMtu() reports it.public RakChannelMetrics getMetrics()
public java.net.InetSocketAddress getRemoteAddress()
protected java.util.Queue<IntRange> getAcknowledgeQueue(boolean nack)
public io.netty.channel.Channel getChannel()