}
@Override
public void run() {
while (HandlerSocketConnectorImpl.this.isStarted()) {
ReconnectRequest request=null;
InetSocketAddress address=null;
try {
request = HandlerSocketConnectorImpl.this.waitingQueue
.take();
address = request.getRemoteAddr();
boolean connected = false;
Future<Boolean> future = HandlerSocketConnectorImpl.this
.connect(request.getRemoteAddr());
request.setTries(request.getTries() + 1);
try {
log.warn("Trying to connect to "
+ address.getAddress().getHostAddress() + ":"
+ address.getPort() + " for "
+ request.getTries() + " times");
if (!future.get(HSClient.DEFAULT_CONNECT_TIMEOUT,
TimeUnit.MILLISECONDS)) {
connected = false;
} else {
connected = true;