net.NettyEngine4.ServerEncoder.java Source code

Java tutorial

Introduction

Here is the source code for net.NettyEngine4.ServerEncoder.java

Source

/*
 * Copyright (c) 2014. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

package net.NettyEngine4;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;

/**
 * Created with IntelliJ IDEA.
 * User:   </br>
 * Date: 13-10-22            </br>
 * Time: ?4:55              </br>
 * Package_name: Server.ExtComponents.NettyEngine4   </br>
 * ?encoder?byteBuffer                     </br>
 * ??? ?     </br>
 */
public class ServerEncoder extends ChannelOutboundHandlerAdapter {
    /**
     * ? ???????
     * ?bufferisReadabletrue </br>
     * netty?????msgNULL,  </br>
     * GC?                   </br>
     * ??????,msg :PooledHeapByteBuf </br>
     * @param ctx               </br>
     * @param msg      </br>
     * @param promise       </br>
     * @throws Exception          </br>
     */
    @Override
    public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
        ctx.write(msg, promise);
    }
}