public class NetworkManager extends io.netty.channel.SimpleChannelInboundHandler<Packet<?>>
Modifier and Type | Field and Description |
---|---|
static LazyLoadBase<io.netty.channel.epoll.EpollEventLoopGroup> |
CLIENT_EPOLL_EVENTLOOP |
static LazyLoadBase<io.netty.channel.local.LocalEventLoopGroup> |
CLIENT_LOCAL_EVENTLOOP |
static LazyLoadBase<io.netty.channel.nio.NioEventLoopGroup> |
CLIENT_NIO_EVENTLOOP |
static org.apache.logging.log4j.Marker |
NETWORK_MARKER |
static org.apache.logging.log4j.Marker |
NETWORK_PACKETS_MARKER |
static io.netty.util.AttributeKey<EnumConnectionState> |
PROTOCOL_ATTRIBUTE_KEY |
Constructor and Description |
---|
NetworkManager(EnumPacketDirection packetDirection) |
Modifier and Type | Method and Description |
---|---|
io.netty.channel.Channel |
channel() |
void |
channelActive(io.netty.channel.ChannelHandlerContext p_channelActive_1_) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext p_channelInactive_1_) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext p_channelRead0_1_,
Packet<?> p_channelRead0_2_) |
void |
checkDisconnected() |
void |
closeChannel(ITextComponent message) |
static NetworkManager |
createNetworkManagerAndConnect(java.net.InetAddress address,
int serverPort,
boolean useNativeTransport) |
void |
disableAutoRead() |
void |
enableEncryption(javax.crypto.SecretKey key) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext p_exceptionCaught_1_,
java.lang.Throwable p_exceptionCaught_2_) |
EnumPacketDirection |
getDirection() |
ITextComponent |
getExitMessage() |
INetHandler |
getNetHandler() |
java.net.SocketAddress |
getRemoteAddress() |
boolean |
hasNoChannel() |
boolean |
isChannelOpen() |
boolean |
isEncrypted() |
boolean |
isLocalChannel() |
void |
processReceivedPackets() |
static NetworkManager |
provideLocalClient(java.net.SocketAddress address) |
void |
sendPacket(Packet<?> packetIn) |
void |
sendPacket(Packet<?> packetIn,
io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener,
io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners) |
void |
setCompressionThreshold(int threshold) |
void |
setConnectionState(EnumConnectionState newState) |
void |
setNetHandler(INetHandler handler) |
acceptInboundMessage, channelRead
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public static final org.apache.logging.log4j.Marker NETWORK_MARKER
public static final org.apache.logging.log4j.Marker NETWORK_PACKETS_MARKER
public static final io.netty.util.AttributeKey<EnumConnectionState> PROTOCOL_ATTRIBUTE_KEY
public static final LazyLoadBase<io.netty.channel.nio.NioEventLoopGroup> CLIENT_NIO_EVENTLOOP
public static final LazyLoadBase<io.netty.channel.epoll.EpollEventLoopGroup> CLIENT_EPOLL_EVENTLOOP
public static final LazyLoadBase<io.netty.channel.local.LocalEventLoopGroup> CLIENT_LOCAL_EVENTLOOP
public NetworkManager(EnumPacketDirection packetDirection)
public EnumPacketDirection getDirection()
public void channelActive(io.netty.channel.ChannelHandlerContext p_channelActive_1_) throws java.lang.Exception
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
public void setConnectionState(EnumConnectionState newState)
public void channelInactive(io.netty.channel.ChannelHandlerContext p_channelInactive_1_) throws java.lang.Exception
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
public void exceptionCaught(io.netty.channel.ChannelHandlerContext p_exceptionCaught_1_, java.lang.Throwable p_exceptionCaught_2_) throws java.lang.Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
protected void channelRead0(io.netty.channel.ChannelHandlerContext p_channelRead0_1_, Packet<?> p_channelRead0_2_) throws java.lang.Exception
channelRead0
in class io.netty.channel.SimpleChannelInboundHandler<Packet<?>>
java.lang.Exception
public void setNetHandler(INetHandler handler)
public void sendPacket(Packet<?> packetIn)
public void sendPacket(Packet<?> packetIn, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>> listener, io.netty.util.concurrent.GenericFutureListener<? extends io.netty.util.concurrent.Future<? super java.lang.Void>>... listeners)
public void processReceivedPackets()
public java.net.SocketAddress getRemoteAddress()
public void closeChannel(ITextComponent message)
public boolean isLocalChannel()
public static NetworkManager createNetworkManagerAndConnect(java.net.InetAddress address, int serverPort, boolean useNativeTransport)
public static NetworkManager provideLocalClient(java.net.SocketAddress address)
public void enableEncryption(javax.crypto.SecretKey key)
public boolean isEncrypted()
public boolean isChannelOpen()
public boolean hasNoChannel()
public INetHandler getNetHandler()
public ITextComponent getExitMessage()
public void disableAutoRead()
public void setCompressionThreshold(int threshold)
public void checkDisconnected()
public io.netty.channel.Channel channel()