Search in sources :

Example 1 with GameCharsDecoder

use of com.code.server.gate.encoding.GameCharsDecoder in project summer by foxsugar.

the class SocketServerInitializer method initChannel.

@Override
public void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline p = ch.pipeline();
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(ch.alloc()));
    }
    // p.addLast(new LoggingHandler(LogLevel.INFO));
    p.addLast("encoder", new GameCharsEncoder());
    p.addLast("decoder", new GameCharsDecoder());
    p.addLast("timeout", new IdleStateHandler(15, 0, 0, TimeUnit.SECONDS));
    // p.addLast(new SocketHandler());
    p.addLast("gameHandler", new GameMsgHandler());
}
Also used : GameCharsDecoder(com.code.server.gate.encoding.GameCharsDecoder) GameMsgHandler(com.code.server.gate.handle.GameMsgHandler) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) GameCharsEncoder(com.code.server.gate.encoding.GameCharsEncoder) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

GameCharsDecoder (com.code.server.gate.encoding.GameCharsDecoder)1 GameCharsEncoder (com.code.server.gate.encoding.GameCharsEncoder)1 GameMsgHandler (com.code.server.gate.handle.GameMsgHandler)1 ChannelPipeline (io.netty.channel.ChannelPipeline)1 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)1