@Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        //discard the received msg silently
//        ((ByteBuf) msg).release();
        
        //do something instead of just discard
        try {
            ByteBuf in = (ByteBuf) msg;
            while (in.isReadable()) {
                System.out.print((char)in.readByte());
                System.out.flush();
            }
            System.out.print('\n');
        } finally {
            ReferenceCountUtil.release(msg);
        }
    }