From 58620ac519ce3124cbebc2f1fb58a989c2c3a69f Mon Sep 17 00:00:00 2001 From: redkale Date: Wed, 30 Aug 2023 08:31:30 +0800 Subject: [PATCH] AsyncNioConnection --- src/main/java/org/redkale/net/AsyncNioConnection.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/redkale/net/AsyncNioConnection.java b/src/main/java/org/redkale/net/AsyncNioConnection.java index c1da68dc5..3d3f4b855 100644 --- a/src/main/java/org/redkale/net/AsyncNioConnection.java +++ b/src/main/java/org/redkale/net/AsyncNioConnection.java @@ -384,7 +384,6 @@ abstract class AsyncNioConnection extends AsyncConnection { int totalCount = 0; boolean hasRemain = true; boolean writeCompleted = true; - boolean fastMode = false; if (writeByteBuffer == null && writeByteBuffers == null && writeByteTuple1Array == null && fastWriteCount.get() > 0) { final ByteBuffer buffer = pollWriteBuffer(); ByteBufferWriter writer = null; @@ -400,7 +399,6 @@ abstract class AsyncNioConnection extends AsyncConnection { writer.put(item); } } - fastMode = true; this.writeBuffersOffset = 0; if (writer == null) { this.writeByteBuffer = buffer.flip(); @@ -501,7 +499,8 @@ abstract class AsyncNioConnection extends AsyncConnection { if (writeCompleted && (totalCount != 0 || !hasRemain)) { handleWrite(this.writeTotal + totalCount, null); - if (fastMode && fastWriteCount.get() > 0) { + if (fastWriteCount.get() > 0) { + this.writePending = true; doWrite(); } } else if (writeKey == null) {