ソースを参照

use the default settings for the PooledByteBufAllocator

Luis Filipe dos Santos Neves 11 年 前
コミット
340493eaf7
1 ファイル変更3 行追加2 行削除
  1. 3 2
      netty/src/main/java/hello/HelloWebServer.java

+ 3 - 2
netty/src/main/java/hello/HelloWebServer.java

@@ -16,7 +16,7 @@ import io.netty.util.ResourceLeakDetector.Level;
 
 
 public class HelloWebServer {
-	private static int IO_THREADS = Runtime.getRuntime().availableProcessors() * 2;
+
     static {
         ResourceLeakDetector.setLevel(Level.DISABLED);
     }
@@ -45,7 +45,7 @@ public class HelloWebServer {
 			b.option(ChannelOption.SO_REUSEADDR, true);
 			b.group(loupGroup).channel(serverChannelClass).childHandler(new HelloServerInitializer(loupGroup.next()));			
             b.option(ChannelOption.MAX_MESSAGES_PER_READ, Integer.MAX_VALUE);
-            b.childOption(ChannelOption.ALLOCATOR, new PooledByteBufAllocator(true, IO_THREADS, IO_THREADS, 8192, 11));
+            b.childOption(ChannelOption.ALLOCATOR, new PooledByteBufAllocator(true));
             b.childOption(ChannelOption.SO_REUSEADDR, true);
             b.childOption(ChannelOption.MAX_MESSAGES_PER_READ, Integer.MAX_VALUE);
 
@@ -67,3 +67,4 @@ public class HelloWebServer {
         new HelloWebServer(port).run();
     }
 }
+