try (DBCursor cursor = BridgeExchangerContext.this.config.collection().find(BasicDBObjectBuilder.start(BridgeExchangerContext.this.date, BasicDBObjectBuilder.start("$lt", System.currentTimeMillis() - BridgeExchangerContext.this.timeout).get()).get(), BridgeExchangerContext.this.filter)) {
while (cursor.hasNext()) {
Exchanger exchanger = BridgeExchangerContext.this.activate(MongoUtils.asString(DBObject.class.cast(cursor.next()), Dictionary.FIELD_HOST));
// Double check 4 multi thread
if (exchanger != null) {
BridgeExchangerContext.this.log.warn("Timeout socks: " + exchanger.host());
exchanger.close(Terminal.ALL);
}
}
}
return this;