package com.manning.nettyinaction.chapter6; import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; /** * * Listing 6.9 of <i>Netty in Action</i> * * @author <a href="mailto:norman.maurer@googlemail.com">Norman Maurer</a> */ public class WriteHandler extends ChannelHandlerAdapter { private ChannelHandlerContext ctx; @Override public void handlerAdded(ChannelHandlerContext ctx) { this.ctx = ctx; } public void send(String msg) { ctx.writeAndFlush(msg); } }