也许这是一个明显的问题,但我对netty来说太新了。Netty HttpChunckAggregator有状态 - >竞态条件?
看看HttpChunckAggregator类,我发现它是有状态的。这让我怀疑...给出以下管道的特定频道:
private MyServerHandler handler;
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = pipeline();
pipeline.addLast("decoder",new HttpRequestDecoder());
pipeline.addLast("chunkAggregator",new HttpChunkAggregator(4194304));
pipeline.addLast("encoder",new HttpResponseEncoder());
pipeline.addLast("chunkSeparator",new HttpChunkSeparator(4194304));
pipeline.addLast("handler", handler); //Singleton
return pipeline;
}
和NIO Netty的服务器,我能得到的比赛条件,分块消息和多线程的情况下?
我看到每个新通道都会创建一个新的块聚合器,但是......所有的块消息都将在同一个通道中接收到?