Java tutorial
/* * @(#)EchoServerHandler.java $version 2015. 8. 19. * * Copyright 2015 NHN Ent. All rights Reserved. * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.cdg.study.netty.echo; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; /** * ?? ???? ? * * @author Kanghoon Choi */ public class EchoServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext context, Object msg) { context.write(msg); context.flush(); } @Override public void channelReadComplete(ChannelHandlerContext context) { context.flush(); } @Override public void exceptionCaught(ChannelHandlerContext context, Throwable cause) { cause.printStackTrace(); context.close(); } }