From ecb29c1688857f77fb77eb5ca3acf86cc62ef754 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sat, 12 Jan 2013 00:08:05 +0000 Subject: [PATCH] More control over Threading model of the server. --- .../java/com/gempukku/lotro/async/LotroAsyncServer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/LotroAsyncServer.java b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/LotroAsyncServer.java index 927b6318d..7d6d85d7b 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/LotroAsyncServer.java +++ b/gemp-lotr/gemp-lotr-async/src/main/java/com/gempukku/lotro/async/LotroAsyncServer.java @@ -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())); ServerBootstrap bootstrap = new ServerBootstrap(factory);