Use smaller number of boss threads in the example

.. because usually there's no need to use many boss threads.
This commit is contained in:
Trustin Lee 2014-02-07 14:42:49 -08:00
parent ea345f6421
commit 87b853c60d
23 changed files with 23 additions and 23 deletions

View File

@ -41,7 +41,7 @@ public class AppletDiscardServer extends JApplet {
@Override @Override
public void init() { public void init() {
bossGroup = new NioEventLoopGroup(); bossGroup = new NioEventLoopGroup(1);
workerGroup = new NioEventLoopGroup(); workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap bootstrap = new ServerBootstrap(); ServerBootstrap bootstrap = new ServerBootstrap();

View File

@ -35,7 +35,7 @@ public class DiscardServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -39,7 +39,7 @@ public class EchoServer {
public void run() throws Exception { public void run() throws Exception {
// Configure the server. // Configure the server.
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -33,7 +33,7 @@ public class FactorialServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -50,7 +50,7 @@ public class FileServer {
public void run() throws Exception { public void run() throws Exception {
// Configure the server. // Configure the server.
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -75,7 +75,7 @@ public class HttpServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -29,7 +29,7 @@ public class HttpStaticFileServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -36,7 +36,7 @@ public class HttpHelloWorldServer {
public void run() throws Exception { public void run() throws Exception {
// Configure the server. // Configure the server.
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -35,7 +35,7 @@ public class HttpSnoopServer {
public void run() throws Exception { public void run() throws Exception {
// Configure the server. // Configure the server.
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -34,7 +34,7 @@ public class HttpUploadServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -58,7 +58,7 @@ public class WebSocketServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
final ServerBootstrap sb = new ServerBootstrap(); final ServerBootstrap sb = new ServerBootstrap();

View File

@ -49,7 +49,7 @@ public class WebSocketServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -48,7 +48,7 @@ public class WebSocketSslServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -38,7 +38,7 @@ public class ObjectEchoServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -38,7 +38,7 @@ public class PortUnificationServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -39,7 +39,7 @@ public class HexDumpProxy {
remoteHost + ':' + remotePort + " ..."); remoteHost + ':' + remotePort + " ...");
// Configure the bootstrap. // Configure the bootstrap.
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -39,7 +39,7 @@ public class NioSctpEchoServer {
public void run() throws Exception { public void run() throws Exception {
// Configure the server. // Configure the server.
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -39,7 +39,7 @@ public class OioSctpEchoServer {
public void run() throws Exception { public void run() throws Exception {
// Configure the server. // Configure the server.
EventLoopGroup bossGroup = new OioEventLoopGroup(); EventLoopGroup bossGroup = new OioEventLoopGroup(1);
EventLoopGroup workerGroup = new OioEventLoopGroup(); EventLoopGroup workerGroup = new OioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -33,7 +33,7 @@ public class SecureChatServer {
} }
public void run() throws InterruptedException { public void run() throws InterruptedException {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -30,7 +30,7 @@ public final class SocksServer {
public void run() throws Exception { public void run() throws Exception {
System.err.println( System.err.println(
"Listening on*:" + localPort + "..."); "Listening on*:" + localPort + "...");
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -50,7 +50,7 @@ public class SpdyServer {
public void run() throws Exception { public void run() throws Exception {
// Configure the server. // Configure the server.
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -32,7 +32,7 @@ public class TelnetServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();

View File

@ -33,7 +33,7 @@ public class WorldClockServer {
} }
public void run() throws Exception { public void run() throws Exception {
EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup bossGroup = new NioEventLoopGroup(1);
EventLoopGroup workerGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup();
try { try {
ServerBootstrap b = new ServerBootstrap(); ServerBootstrap b = new ServerBootstrap();