Add javadocs and cleanup. Part of #613
This commit is contained in:
parent
0ee4bbf8e7
commit
ef0ee5f7ba
@ -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<NioWorker> 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<NioWorker> workerPool, Timer timer) {
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user