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; p = i;
addr = remoteAddres[i]; addr = remoteAddres[i];
BlockingQueue<AsyncConnection> queue = connPool.get(addr); BlockingQueue<AsyncConnection> queue = connPool.get(addr);
if (queue != null && queue.isEmpty()) { if (queue != null && !queue.isEmpty()) {
AsyncConnection conn = queue.poll(); AsyncConnection conn;
if (conn.isOpen()) return conn; while ((conn = queue.poll()) != null) {
if (conn.isOpen()) return conn;
}
} }
if (channel == null) channel = AsynchronousSocketChannel.open(group); if (channel == null) channel = AsynchronousSocketChannel.open(group);
try { try {