}
logger.fine("Get connection to "+ router.getAddress() + " "+ router.getOnionPort() + " " + router.getNickname());
while(true) {
Future<ConnectionImpl> f = getFutureFor(router, isDirectoryConnection);
try {
Connection c = f.get();
if(c.isClosed()) {
activeConnections.remove(router, f);
} else {
return c;
}
} catch (CancellationException e) {