这是我的工具,对吗?
public ChannelPipeline getPipeline() throws Exception
{
ChannelPipeline p = pipeline();
pipeline.addLast("decoder", new HttpRequestDecoder());
p.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
p.addLast("protobufDecoder", new ProtobufDecoder(LocalTimeProtocol.Locations.getDefaultInstance()));
pipeline.addLast("encoder", new HttpResponseEncoder());
p.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
p.addLast("protobufEncoder", new ProtobufEncoder());
p.addLast("handler", new LocalTimeServerHandler());
return p;
}