This commit is contained in:
地平线
2015-08-13 09:36:38 +08:00
parent 035db427e1
commit f01c0a741d

View File

@@ -107,9 +107,11 @@ public final class Transport {
p = i;
addr = remoteAddres[i];
BlockingQueue<AsyncConnection> queue = connPool.get(addr);
if (queue != null && queue.isEmpty()) {
AsyncConnection conn = queue.poll();
if (conn.isOpen()) return conn;
if (queue != null && !queue.isEmpty()) {
AsyncConnection conn;
while ((conn = queue.poll()) != null) {
if (conn.isOpen()) return conn;
}
}
if (channel == null) channel = AsynchronousSocketChannel.open(group);
try {