More control over Threading model of the server.

This commit is contained in:
marcins78@gmail.com
2013-01-12 00:08:05 +00:00
parent c22a7de1f3
commit ecb29c1688

View File

@@ -7,13 +7,18 @@ import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import java.net.InetSocketAddress;
import java.util.concurrent.Executors;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class LotroAsyncServer {
public static void main(String[] server) {
ChannelFactory factory =
new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newFixedThreadPool(10));
new ThreadPoolExecutor(10, Integer.MAX_VALUE,
60L, TimeUnit.SECONDS,
new SynchronousQueue<Runnable>()));
ServerBootstrap bootstrap = new ServerBootstrap(factory);