1package com.runehive.net;
3import com.runehive.Config;
4import com.runehive.net.session.Session;
5import io.netty.channel.ChannelHandlerContext;
6import io.netty.channel.SimpleChannelInboundHandler;
7import io.netty.handler.timeout.IdleState;
8import io.netty.handler.timeout.IdleStateEvent;
9import org.apache.logging.log4j.LogManager;
10import org.apache.logging.log4j.Logger;
18public final class ChannelHandler extends SimpleChannelInboundHandler<Object> {
29 }
catch (Exception ex) {
30 logger.error(
"Error reading channel!", ex);
44 if (evt instanceof IdleStateEvent) {
45 IdleStateEvent
event = (IdleStateEvent) evt;
46 if (event.state() == IdleState.READER_IDLE) {
47 ctx.channel().close();
55 logger.error(
"Exception caught upstream!", e);
The class that contains setting-related constants for the server.
static final ObjectSet< String > IGNORED_EXCEPTIONS
The list of exceptions that are ignored and discarded by the.
static final AttributeKey< Session > SESSION_KEY
The session key.
A SimpleChannelInboundHandler implementation for re-routing channel-events to its bound Session.
static final Logger logger
void channelInactive(ChannelHandlerContext ctx)
void exceptionCaught(ChannelHandlerContext ctx, Throwable e)
void userEventTriggered(ChannelHandlerContext ctx, Object evt)
void channelRead0(ChannelHandlerContext ctx, Object o)
Represents a session between a user and the server.