1package dev.advo.fs.net.service;
3import org.jboss.netty.buffer.ChannelBuffer;
4import org.jboss.netty.buffer.ChannelBuffers;
5import org.jboss.netty.channel.Channel;
6import org.jboss.netty.channel.ChannelHandlerContext;
7import org.jboss.netty.channel.ChannelPipeline;
8import org.jboss.netty.handler.codec.frame.FrameDecoder;
20 protected Object
decode(ChannelHandlerContext ctx, Channel c, ChannelBuffer buf)
throws Exception {
27 ChannelPipeline pipeline = ctx.getPipeline();
28 pipeline.remove(
this);
32 System.out.println(
"we should not be here, client should request 1 byte. It requested "+ buf.readableBytes());
34 ChannelBuffer b = ChannelBuffers.buffer(1 + buf.readableBytes());
36 b.writeBytes(buf.readBytes(buf.readableBytes()));
38 return new Object[] { request,
ServiceRequestDecoder()
Creates the decoder, enabling the 'unfold' mechanism.
Object decode(ChannelHandlerContext ctx, Channel c, ChannelBuffer buf)