也許這是一個明顯的問題,但我對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的服務器,我能得到的比賽條件,分塊消息和多線程的情況下?
我看到每個新通道都會創建一個新的塊聚合器,但是......所有的塊消息都將在同一個通道中接收到?