Skip to content

Commit

Permalink
Add javadocs and cleanup. Part of #613
Browse files Browse the repository at this point in the history
  • Loading branch information
Norman Maurer committed Sep 21, 2012
1 parent 0ee4bbf commit ef0ee5f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,34 @@ public NioClientSocketChannelFactory(
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
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;
Expand Down Expand Up @@ -265,7 +264,6 @@ public void run() {
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;
Expand Down Expand Up @@ -362,7 +360,6 @@ public void run() {

// 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.
Expand Down

0 comments on commit ef0ee5f

Please sign in to comment.