This commit is contained in:
Redkale
2018-05-30 18:48:52 +08:00
parent d5409518ed
commit ae8fb992fb
2 changed files with 6 additions and 5 deletions

View File

@@ -178,10 +178,7 @@ public abstract class Response<C extends Context, R extends Request<C>> {
this.servlet = null;
request.recycle();
if (channel != null) {
try {
if (channel.isOpen()) channel.close();
} catch (Exception e) {
}
channel.dispose();
channel = null;
}
this.inited = false;

View File

@@ -227,7 +227,11 @@ public final class Transport {
if (!queue.isEmpty()) {
AsyncConnection conn;
while ((conn = queue.poll()) != null) {
if (conn.isOpen()) return CompletableFuture.completedFuture(conn);
if (conn.isOpen()) {
return CompletableFuture.completedFuture(conn);
} else {
conn.dispose();
}
}
}
return AsyncConnection.createTCP(group, sslContext, addr, supportTcpNoDelay(), factory.readTimeoutSeconds, factory.writeTimeoutSeconds);