package io.github.kuyer.jbase.netty.echo;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

public class EchoServerHandler extends ChannelInboundHandlerAdapter {

	@Override
	public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
		ctx.write(msg);
	}

	@Override
	public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
		ctx.flush();
	}

	@Override
	public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
		cause.printStackTrace();
		ctx.close();
	}

}

@@ -36,16 +36,65 @@
 .echo;%0A%0A
+import io.netty.channel.ChannelHandler.Sharable;%0A
 import i
@@ -187,16 +187,26 @@
 apter;%0A%0A
+@Sharable%0A
 public c

update echo netty