Search in sources :

Example 1 with JagGrabResponseEncoder

use of org.apollo.net.codec.jaggrab.JagGrabResponseEncoder in project apollo by apollo-rsps.

the class JagGrabChannelInitializer method initChannel.

@Override
public void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline pipeline = ch.pipeline();
    pipeline.addLast("framer", new DelimiterBasedFrameDecoder(MAX_REQUEST_LENGTH, DOUBLE_LINE_FEED_DELIMITER));
    pipeline.addLast("string-decoder", new StringDecoder(JAGGRAB_CHARSET));
    pipeline.addLast("jaggrab-decoder", new JagGrabRequestDecoder());
    pipeline.addLast("jaggrab-encoder", new JagGrabResponseEncoder());
    pipeline.addLast("timeout", new IdleStateHandler(NetworkConstants.IDLE_TIME, 0, 0));
    pipeline.addLast("handler", handler);
}
Also used : JagGrabResponseEncoder(org.apollo.net.codec.jaggrab.JagGrabResponseEncoder) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) DelimiterBasedFrameDecoder(io.netty.handler.codec.DelimiterBasedFrameDecoder) StringDecoder(io.netty.handler.codec.string.StringDecoder) JagGrabRequestDecoder(org.apollo.net.codec.jaggrab.JagGrabRequestDecoder) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

ChannelPipeline (io.netty.channel.ChannelPipeline)1 DelimiterBasedFrameDecoder (io.netty.handler.codec.DelimiterBasedFrameDecoder)1 StringDecoder (io.netty.handler.codec.string.StringDecoder)1 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)1 JagGrabRequestDecoder (org.apollo.net.codec.jaggrab.JagGrabRequestDecoder)1 JagGrabResponseEncoder (org.apollo.net.codec.jaggrab.JagGrabResponseEncoder)1