This commit is contained in:
@@ -390,6 +390,7 @@ public class TcpNioAsyncConnection extends AsyncConnection {
|
|||||||
totalCount += readCount;
|
totalCount += readCount;
|
||||||
}
|
}
|
||||||
if (totalCount != 0 || !hasRemain) {
|
if (totalCount != 0 || !hasRemain) {
|
||||||
|
if (readKey != null) readKey.interestOps(readKey.interestOps() & ~SelectionKey.OP_READ);
|
||||||
CompletionHandler<Integer, ByteBuffer> handler = this.readCompletionHandler;
|
CompletionHandler<Integer, ByteBuffer> handler = this.readCompletionHandler;
|
||||||
ByteBuffer attach = this.readByteBuffer;
|
ByteBuffer attach = this.readByteBuffer;
|
||||||
clearRead();
|
clearRead();
|
||||||
@@ -401,7 +402,6 @@ public class TcpNioAsyncConnection extends AsyncConnection {
|
|||||||
this.workExecutor.execute(() -> handler.completed(totalCount0, attach));
|
this.workExecutor.execute(() -> handler.completed(totalCount0, attach));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (readKey != null) readKey.interestOps(readKey.interestOps() & ~SelectionKey.OP_READ);
|
|
||||||
} else if (readKey == null) {
|
} else if (readKey == null) {
|
||||||
ioThread.register(selector -> {
|
ioThread.register(selector -> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ public class NioThread extends Thread {
|
|||||||
it.remove();
|
it.remove();
|
||||||
TcpNioAsyncConnection conn = (TcpNioAsyncConnection) key.attachment();
|
TcpNioAsyncConnection conn = (TcpNioAsyncConnection) key.attachment();
|
||||||
if (key.isWritable()) {
|
if (key.isWritable()) {
|
||||||
key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE);
|
|
||||||
conn.doWrite();
|
conn.doWrite();
|
||||||
} else if (key.isReadable()) {
|
} else if (key.isReadable()) {
|
||||||
conn.doRead();
|
conn.doRead();
|
||||||
|
|||||||
Reference in New Issue
Block a user