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(RakDisconnectReason reason) |
void |
disconnect() |
void |
disconnect(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.ChannelPromise promise) |
void |
disconnect(RakDisconnectReason reason) |
void |
flush(io.netty.channel.ChannelHandlerContext ctx) |
protected java.util.Queue<IntRange> |
getAcknowledgeQueue(boolean nack) |
io.netty.channel.Channel |
getChannel() |
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) |
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()
public void disconnect(RakDisconnectReason reason)
public void close(RakDisconnectReason reason)
public boolean isClosed()
public void recalculatePongTime(long pingTime)
public boolean isStale(long curTime)
curTime - reading from RakUtils.clock(), not a wall clockpublic boolean isStale()
public boolean isTimedOut(long curTime)
curTime - reading from RakUtils.clock(), not a wall clockpublic boolean isTimedOut()
public long getPing()
public double getRTT()
public int getMtu()
public RakChannelMetrics getMetrics()
public java.net.InetSocketAddress getRemoteAddress()
protected java.util.Queue<IntRange> getAcknowledgeQueue(boolean nack)
public io.netty.channel.Channel getChannel()