Java tutorial
/******************************************************************************* * Copyright (c) HALive, 2015. * For Licence information see LICENSE.md ******************************************************************************/ package halive.shootinoutside.server.net; import com.badlogic.gdx.Game; import halive.shootinoutside.server.GameServer; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.util.ReferenceCountUtil; public class GameServerHandler extends ChannelHandlerAdapter { private GameServer server; public GameServerHandler(GameServer server) { this.server = server; } @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { } @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { cause.printStackTrace(); ctx.close(); } }