This commit is contained in:
Redkale
2019-11-19 20:47:16 +08:00
parent 934c82eadd
commit b2dd366640
2 changed files with 6 additions and 5 deletions

View File

@@ -207,10 +207,10 @@ public abstract class AsyncConnection implements ReadableByteChannel, WritableBy
}
if (this.readBuffer != null) {
Consumer<ByteBuffer> consumer = this.bufferConsumer;
Thread thread = Thread.currentThread();
if (thread instanceof IOThread) {
consumer = ((IOThread) thread).getBufferPool();
}
// Thread thread = Thread.currentThread();
// if (thread instanceof IOThread) {
// consumer = ((IOThread) thread).getBufferPool();
// }
consumer.accept(this.readBuffer);
}
if (attributes == null) return;

View File

@@ -104,7 +104,8 @@ public class TcpAioProtocolServer extends ProtocolServer {
AsyncConnection conn = new TcpAioAsyncConnection(bufferPool, bufferPool, channel,
context.getSSLContext(), null, context.readTimeoutSeconds, context.writeTimeoutSeconds, livingCounter, closedCounter);
context.runAsync(new PrepareRunner(context, responsePool, conn, null, null));
//context.runAsync(new PrepareRunner(context, responsePool, conn, null, null));
new PrepareRunner(context, responsePool, conn, null, null).run();
} catch (Throwable e) {
context.logger.log(Level.INFO, channel + " accept error", e);
}