diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketChannelFactory.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketChannelFactory.java index 4a75ab6f94..f1fec87258 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketChannelFactory.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketChannelFactory.java @@ -152,12 +152,34 @@ public class NioClientSocketChannelFactory implements ClientSocketChannelFactory this(bossExecutor, bossCount, new NioWorkerPool(workerExecutor, workerCount)); } + /** + * Creates a new instance. + * + * @param bossExecutor + * the {@link Executor} which will execute the boss thread + * @param bossCount + * the maximum number of boss threads + * @param workerPool + * the {@link WorkerPool} to use to do the IO + */ public NioClientSocketChannelFactory( Executor bossExecutor, int bossCount, WorkerPool workerPool) { this(bossExecutor, bossCount, workerPool, new HashedWheelTimer()); } + /** + * Creates a new instance. + * + * @param bossExecutor + * the {@link Executor} which will execute the boss thread + * @param bossCount + * the maximum number of boss threads + * @param workerPool + * the {@link WorkerPool} to use to do the IO + * @param timer + * the {@link Timer} to use to handle the connection timeouts + */ public NioClientSocketChannelFactory( Executor bossExecutor, int bossCount, WorkerPool workerPool, Timer timer) { diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java index 3d79ce51fa..2f8e26f096 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioClientSocketPipelineSink.java @@ -46,7 +46,6 @@ import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.logging.InternalLogger; import org.jboss.netty.logging.InternalLoggerFactory; -import org.jboss.netty.util.HashedWheelTimer; import org.jboss.netty.util.Timeout; import org.jboss.netty.util.Timer; import org.jboss.netty.util.TimerTask; @@ -265,7 +264,6 @@ class NioClientSocketPipelineSink extends AbstractNioChannelSink { int selectReturnsImmediately = 0; Selector selector = this.selector; - long lastConnectTimeoutCheckTimeNanos = System.nanoTime(); // use 80% of the timeout for measure final long minSelectTimeout = SelectorUtil.SELECT_TIMEOUT_NANOS * 80 / 100; @@ -362,7 +360,6 @@ class NioClientSocketPipelineSink extends AbstractNioChannelSink { // Handle connection timeout every 10 milliseconds approximately. long currentTimeNanos = System.nanoTime(); - lastConnectTimeoutCheckTimeNanos = currentTimeNanos; processConnectTimeout(selector.keys(), currentTimeNanos); // Exit the loop when there's nothing to handle.