Call cleanUp() before looping isStartup().

This commit is contained in:
Boris Schrijver 2015-09-21 16:54:56 +02:00
parent a5ca762acb
commit 9693b97c21
1 changed files with 5 additions and 3 deletions

View File

@ -394,15 +394,17 @@ public class Agent implements HandlerFactory, IAgentControl {
} while (inProgress > 0);
_connection.stop();
while (_connection.isStartup()) {
_shell.getBackoffAlgorithm().waitBeforeRetry();
}
try {
_connection.cleanUp();
} catch (final IOException e) {
s_logger.warn("Fail to clean up old connection. " + e);
}
while (_connection.isStartup()) {
_shell.getBackoffAlgorithm().waitBeforeRetry();
}
_connection = new NioClient("Agent", _shell.getHost(), _shell.getPort(), _shell.getWorkers(), this);
do {
s_logger.info("Reconnecting...");