CLOUDSTACK-9348: Reduce Nio selector wait time

This reduced the Nio loop selector wait time, this way the selector will
check frequently (as much as 100ms per iteration) and handle any pending
connection/tasks. This would make reconnections very quick at the expense of
some CPU usage.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2016-07-01 14:32:58 +05:30
parent e4ba640a28
commit 0381b7ea18

View File

@ -125,7 +125,7 @@ public abstract class NioConnection implements Callable<Boolean> {
public Boolean call() throws NioConnectionException {
while (_isRunning) {
try {
_selector.select(1000);
_selector.select(100);
// Someone is ready for I/O, get the ready keys
final Set<SelectionKey> readyKeys = _selector.selectedKeys();