diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index de95ad1e8d..7c27a82e6d 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -40,13 +40,13 @@ private[akka] class NettyRemoteTransport(_system: ExtendedActorSystem, _provider // TODO replace by system.scheduler val timer: HashedWheelTimer = new HashedWheelTimer(system.threadFactory) - val clientChannelFactory = settings.UseDispatcherForIO match { + val clientChannelFactory = { + settings.UseDispatcherForIO match { case Some(id) ⇒ val d = system.dispatchers.lookup(id) - new NioClientSocketChannelFactory(d, d) + new NioClientSocketChannelFactory(d, d, settings.ClientSocketWorkerPoolSize) case None ⇒ - new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), - settings.ClientSocketWorkerPoolSize) + new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), settings.ClientSocketWorkerPoolSize) } /** diff --git a/akka-remote/src/main/scala/akka/remote/netty/Server.scala b/akka-remote/src/main/scala/akka/remote/netty/Server.scala index 1f083bcab5..2f76b324cd 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/Server.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/Server.scala @@ -29,10 +29,9 @@ private[akka] class NettyRemoteServer(val netty: NettyRemoteTransport) { settings.UseDispatcherForIO match { case Some(id) ⇒ val d = netty.system.dispatchers.lookup(id) - new NioServerSocketChannelFactory(d, d) + new NioServerSocketChannelFactory(d, d, settings.ServerSocketWorkerPoolSize) case None ⇒ - new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), - settings.ServerSocketWorkerPoolSize) + new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool(), settings.ServerSocketWorkerPoolSize) } // group of open channels, used for clean-up