From 03277ce0f83c0b6063b40a919e2d510547f357c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Fri, 3 Mar 2023 12:35:44 +0800 Subject: [PATCH 01/10] v1.5.25-SNAPSHOT --- aio-core/pom.xml | 2 +- .../org/smartboot/socket/buffer/BufferPage.java | 4 ++-- .../socket/transport/IoServerConfig.java | 2 +- aio-enhance/pom.xml | 2 +- .../enhance/EnhanceAsynchronousChannelGroup.java | 16 +++++++++++----- aio-pro/pom.xml | 2 +- benchmark/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- smart-socket-parent/pom.xml | 8 ++++---- 10 files changed, 24 insertions(+), 18 deletions(-) diff --git a/aio-core/pom.xml b/aio-core/pom.xml index 115ea3b1..625f61ce 100644 --- a/aio-core/pom.xml +++ b/aio-core/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.6.3-SNAPSHOT + 1.5.25-SNAPSHOT ../smart-socket-parent diff --git a/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java b/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java index 238e1296..51f615cb 100644 --- a/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java +++ b/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java @@ -10,7 +10,7 @@ package org.smartboot.socket.buffer; -import sun.misc.Unsafe; +import sun.nio.ch.DirectBuffer; import java.nio.ByteBuffer; import java.util.Iterator; @@ -275,7 +275,7 @@ public final class BufferPage { */ void release() { if (buffer.isDirect()) { - Unsafe.getUnsafe().invokeCleaner(buffer); + ((DirectBuffer) buffer).cleaner().clean(); } } diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java index 7474327c..a12590d9 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java @@ -39,7 +39,7 @@ final class IoServerConfig { /** * 当前smart-socket版本号 */ - public static final String VERSION = "v1.6.3-SNAPSHOT"; + public static final String VERSION = "v1.5.25-SNAPSHOT"; /** * 消息体缓存大小,字节 diff --git a/aio-enhance/pom.xml b/aio-enhance/pom.xml index 00e6596a..5f69d24e 100644 --- a/aio-enhance/pom.xml +++ b/aio-enhance/pom.xml @@ -14,7 +14,7 @@ smart-socket-parent org.smartboot.socket - 1.6.3-SNAPSHOT + 1.5.25-SNAPSHOT ../smart-socket-parent 4.0.0 diff --git a/aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java b/aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java index 326e4385..6d66d2f8 100644 --- a/aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java +++ b/aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java @@ -14,6 +14,7 @@ import java.nio.channels.AsynchronousChannelGroup; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.spi.AsynchronousChannelProvider; +import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; @@ -203,17 +204,22 @@ class EnhanceAsynchronousChannelGroup extends AsynchronousChannelGroup { public final void run() { workerThread = Thread.currentThread(); // 优先获取SelectionKey,若无关注事件触发则阻塞在selector.select(),减少select被调用次数 - Consumer action = selectionKey -> { - invoker = 0; - consumer.accept(selectionKey); - }; + // 优先获取SelectionKey,若无关注事件触发则阻塞在selector.select(),减少select被调用次数 + Set keySet = selector.selectedKeys(); try { while (running) { Consumer selectorConsumer; while ((selectorConsumer = consumers.poll()) != null) { selectorConsumer.accept(selector); } - selector.select(action); + selector.select(); + + // 执行本次已触发待处理的事件 + for (SelectionKey key : keySet) { + invoker = 0; + consumer.accept(key); + } + keySet.clear(); } } catch (Exception e) { e.printStackTrace(); diff --git a/aio-pro/pom.xml b/aio-pro/pom.xml index f71ec98b..35fccf59 100644 --- a/aio-pro/pom.xml +++ b/aio-pro/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.6.3-SNAPSHOT + 1.5.25-SNAPSHOT ../smart-socket-parent diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 8b96c8b6..16130af4 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -18,7 +18,7 @@ org.smartboot.socket aio-pro - 1.6.3-SNAPSHOT + 1.5.25-SNAPSHOT org.slf4j diff --git a/example/pom.xml b/example/pom.xml index c95e0dfa..941db8da 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -23,7 +23,7 @@ org.smartboot.socket aio-pro - 1.6.3-SNAPSHOT + 1.5.25-SNAPSHOT org.apache.commons diff --git a/pom.xml b/pom.xml index 90e0e684..769cc683 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.smartboot.socket smart-socket-parent - 1.6.3-SNAPSHOT + 1.5.25-SNAPSHOT 2.6 diff --git a/smart-socket-parent/pom.xml b/smart-socket-parent/pom.xml index 9ad0da1c..1e97d4fd 100644 --- a/smart-socket-parent/pom.xml +++ b/smart-socket-parent/pom.xml @@ -15,14 +15,14 @@ 4.0.0 org.smartboot.socket smart-socket-parent - 1.6.3-SNAPSHOT + 1.5.25-SNAPSHOT pom UTF-8 1.7.36 - 1.6.3-SNAPSHOT + 1.5.25-SNAPSHOT 4.13.2 @@ -118,8 +118,8 @@ org.apache.maven.plugins maven-compiler-plugin - 11 - 11 + 1.8 + 1.8 UTF-8 -- Gitee From 8e4115db6b366e9ea35c9971bb3b927b86d1f53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Fri, 3 Mar 2023 23:20:29 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=881.5.25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio-core/pom.xml | 2 +- .../java/org/smartboot/socket/transport/IoServerConfig.java | 2 +- aio-enhance/pom.xml | 2 +- aio-pro/pom.xml | 2 +- benchmark/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- smart-socket-parent/pom.xml | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/aio-core/pom.xml b/aio-core/pom.xml index 625f61ce..e3cf1300 100644 --- a/aio-core/pom.xml +++ b/aio-core/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.5.25-SNAPSHOT + 1.5.25 ../smart-socket-parent diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java index a12590d9..872cd3b8 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java @@ -39,7 +39,7 @@ final class IoServerConfig { /** * 当前smart-socket版本号 */ - public static final String VERSION = "v1.5.25-SNAPSHOT"; + public static final String VERSION = "v1.5.25"; /** * 消息体缓存大小,字节 diff --git a/aio-enhance/pom.xml b/aio-enhance/pom.xml index 5f69d24e..51a28a2a 100644 --- a/aio-enhance/pom.xml +++ b/aio-enhance/pom.xml @@ -14,7 +14,7 @@ smart-socket-parent org.smartboot.socket - 1.5.25-SNAPSHOT + 1.5.25 ../smart-socket-parent 4.0.0 diff --git a/aio-pro/pom.xml b/aio-pro/pom.xml index 35fccf59..a8203e98 100644 --- a/aio-pro/pom.xml +++ b/aio-pro/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.5.25-SNAPSHOT + 1.5.25 ../smart-socket-parent diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 16130af4..d22ec9e4 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -18,7 +18,7 @@ org.smartboot.socket aio-pro - 1.5.25-SNAPSHOT + 1.5.25 org.slf4j diff --git a/example/pom.xml b/example/pom.xml index 941db8da..9310cd8b 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -23,7 +23,7 @@ org.smartboot.socket aio-pro - 1.5.25-SNAPSHOT + 1.5.25 org.apache.commons diff --git a/pom.xml b/pom.xml index 769cc683..d6506dad 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.smartboot.socket smart-socket-parent - 1.5.25-SNAPSHOT + 1.5.25 2.6 diff --git a/smart-socket-parent/pom.xml b/smart-socket-parent/pom.xml index 1e97d4fd..41537dca 100644 --- a/smart-socket-parent/pom.xml +++ b/smart-socket-parent/pom.xml @@ -15,14 +15,14 @@ 4.0.0 org.smartboot.socket smart-socket-parent - 1.5.25-SNAPSHOT + 1.5.25 pom UTF-8 1.7.36 - 1.5.25-SNAPSHOT + 1.5.25 4.13.2 -- Gitee From 168eeb4662afc923375a8c5678533317e7e18d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Tue, 4 Apr 2023 21:40:08 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=881.5.26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio-core/pom.xml | 2 +- .../smartboot/socket/transport/IoServerConfig.java | 2 +- aio-enhance/pom.xml | 2 +- aio-pro/pom.xml | 2 +- benchmark/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- smart-socket-parent/pom.xml | 12 ++++++++++-- 8 files changed, 17 insertions(+), 9 deletions(-) diff --git a/aio-core/pom.xml b/aio-core/pom.xml index e3cf1300..4e212f4f 100644 --- a/aio-core/pom.xml +++ b/aio-core/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.5.25 + 1.5.26 ../smart-socket-parent diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java index 872cd3b8..d9f244f2 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java @@ -39,7 +39,7 @@ final class IoServerConfig { /** * 当前smart-socket版本号 */ - public static final String VERSION = "v1.5.25"; + public static final String VERSION = "v1.5.26"; /** * 消息体缓存大小,字节 diff --git a/aio-enhance/pom.xml b/aio-enhance/pom.xml index 51a28a2a..ae19e706 100644 --- a/aio-enhance/pom.xml +++ b/aio-enhance/pom.xml @@ -14,7 +14,7 @@ smart-socket-parent org.smartboot.socket - 1.5.25 + 1.5.26 ../smart-socket-parent 4.0.0 diff --git a/aio-pro/pom.xml b/aio-pro/pom.xml index a8203e98..c0e77e4f 100644 --- a/aio-pro/pom.xml +++ b/aio-pro/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.5.25 + 1.5.26 ../smart-socket-parent diff --git a/benchmark/pom.xml b/benchmark/pom.xml index d22ec9e4..74d33027 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -18,7 +18,7 @@ org.smartboot.socket aio-pro - 1.5.25 + 1.5.26 org.slf4j diff --git a/example/pom.xml b/example/pom.xml index 9310cd8b..12848674 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -23,7 +23,7 @@ org.smartboot.socket aio-pro - 1.5.25 + 1.5.26 org.apache.commons diff --git a/pom.xml b/pom.xml index d6506dad..aff4c7af 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.smartboot.socket smart-socket-parent - 1.5.25 + 1.5.26 2.6 diff --git a/smart-socket-parent/pom.xml b/smart-socket-parent/pom.xml index 41537dca..c246fa3a 100644 --- a/smart-socket-parent/pom.xml +++ b/smart-socket-parent/pom.xml @@ -15,14 +15,22 @@ 4.0.0 org.smartboot.socket smart-socket-parent - 1.5.25 +<<<<<<< HEAD + 1.5.26 +======= + 1.6.3 +>>>>>>> bugfix-1.6.4 pom UTF-8 1.7.36 - 1.5.25 +<<<<<<< HEAD + 1.5.26 +======= + 1.6.3 +>>>>>>> bugfix-1.6.4 4.13.2 -- Gitee From e0be1b828b016d06c0e10bbbe15c9ea3ed59ce3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Tue, 4 Apr 2023 21:40:57 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=881.5.26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- smart-socket-parent/pom.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/smart-socket-parent/pom.xml b/smart-socket-parent/pom.xml index c246fa3a..1910442d 100644 --- a/smart-socket-parent/pom.xml +++ b/smart-socket-parent/pom.xml @@ -15,22 +15,14 @@ 4.0.0 org.smartboot.socket smart-socket-parent -<<<<<<< HEAD 1.5.26 -======= - 1.6.3 ->>>>>>> bugfix-1.6.4 pom UTF-8 1.7.36 -<<<<<<< HEAD 1.5.26 -======= - 1.6.3 ->>>>>>> bugfix-1.6.4 4.13.2 -- Gitee From dfc03919ca63ba98feec531ab4279d48202946a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Fri, 28 Apr 2023 18:19:00 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=8F=90=E5=8D=87=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=A8=B3=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/smartboot/socket/buffer/BufferPage.java | 3 +++ .../java/org/smartboot/socket/transport/WriteBuffer.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java b/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java index 51f615cb..ae7db4ea 100644 --- a/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java +++ b/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java @@ -82,6 +82,9 @@ public final class BufferPage { * @return 虚拟内存对象 */ public VirtualBuffer allocate(final int size) { + if (size == 0) { + throw new UnsupportedOperationException("cannot allocate zero bytes"); + } VirtualBuffer virtualBuffer; Thread thread = Thread.currentThread(); if (thread instanceof FastBufferThread) { diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/WriteBuffer.java b/aio-core/src/main/java/org/smartboot/socket/transport/WriteBuffer.java index d79e4642..8ec7cd8f 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/WriteBuffer.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/WriteBuffer.java @@ -179,6 +179,9 @@ public final class WriteBuffer extends OutputStream { @Override public synchronized void write(byte[] b, int off, int len) throws IOException { + if (len == 0) { + return; + } if (writeInBuf == null) { writeInBuf = bufferPage.allocate(Math.max(chunkSize, len)); } @@ -254,7 +257,7 @@ public final class WriteBuffer extends OutputStream { } @Override - public void flush() { + public synchronized void flush() { if (closed) { throw new RuntimeException("OutputStream has closed"); } -- Gitee From f8c4d80814d7f38a063344ed23f241d215e247fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Sat, 29 Apr 2023 18:51:01 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E6=8F=90=E5=8D=87=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E7=A8=B3=E5=AE=9A=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/smartboot/socket/transport/TcpAioSession.java | 4 ++-- .../org/smartboot/socket/transport/WriteBuffer.java | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/TcpAioSession.java b/aio-core/src/main/java/org/smartboot/socket/transport/TcpAioSession.java index 11e200e8..04bcb706 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/TcpAioSession.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/TcpAioSession.java @@ -184,10 +184,10 @@ final class TcpAioSession extends AioSession { monitor.afterWrite(this, result); } if (writeBuffer == null) { - writeBuffer = byteBuf.pollItem(); + writeBuffer = byteBuf.poll(); } else if (!writeBuffer.buffer().hasRemaining()) { writeBuffer.clean(); - writeBuffer = byteBuf.pollItem(); + writeBuffer = byteBuf.poll(); } if (writeBuffer != null) { diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/WriteBuffer.java b/aio-core/src/main/java/org/smartboot/socket/transport/WriteBuffer.java index 8ec7cd8f..36d47f23 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/WriteBuffer.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/WriteBuffer.java @@ -257,7 +257,7 @@ public final class WriteBuffer extends OutputStream { } @Override - public synchronized void flush() { + public void flush() { if (closed) { throw new RuntimeException("OutputStream has closed"); } @@ -293,7 +293,7 @@ public final class WriteBuffer extends OutputStream { return count == 0 && (writeInBuf == null || writeInBuf.buffer().position() == 0); } - VirtualBuffer pollItem() { + private VirtualBuffer pollItem() { if (count == 0) { return null; } @@ -302,10 +302,8 @@ public final class WriteBuffer extends OutputStream { if (++takeIndex == items.length) { takeIndex = 0; } - synchronized (this) { - if (count-- == items.length) { - this.notifyAll(); - } + if (count-- == items.length) { + this.notifyAll(); } return x; } -- Gitee From f3068f0bb69a5962047cff711236661236be84ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Sat, 29 Apr 2023 18:55:50 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=881.5.27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio-core/pom.xml | 8 +------ .../EnhanceAsynchronousChannelGroup.java | 0 .../EnhanceAsynchronousChannelProvider.java | 0 ...nhanceAsynchronousServerSocketChannel.java | 0 .../EnhanceAsynchronousSocketChannel.java | 0 .../enhance/FutureCompletionHandler.java | 0 .../socket/transport/IoServerConfig.java | 2 +- aio-enhance/pom.xml | 24 ------------------- aio-pro/pom.xml | 2 +- benchmark/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- smart-socket-parent/pom.xml | 10 ++------ 13 files changed, 8 insertions(+), 44 deletions(-) rename {aio-enhance => aio-core}/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java (100%) rename {aio-enhance => aio-core}/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelProvider.java (100%) rename {aio-enhance => aio-core}/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousServerSocketChannel.java (100%) rename {aio-enhance => aio-core}/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousSocketChannel.java (100%) rename {aio-enhance => aio-core}/src/main/java/org/smartboot/socket/enhance/FutureCompletionHandler.java (100%) delete mode 100644 aio-enhance/pom.xml diff --git a/aio-core/pom.xml b/aio-core/pom.xml index 4e212f4f..e0e4d031 100644 --- a/aio-core/pom.xml +++ b/aio-core/pom.xml @@ -19,13 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.5.26 + 1.5.27 ../smart-socket-parent - - - org.smartboot.socket - aio-enhance - - diff --git a/aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java b/aio-core/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java similarity index 100% rename from aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java rename to aio-core/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelGroup.java diff --git a/aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelProvider.java b/aio-core/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelProvider.java similarity index 100% rename from aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelProvider.java rename to aio-core/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousChannelProvider.java diff --git a/aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousServerSocketChannel.java b/aio-core/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousServerSocketChannel.java similarity index 100% rename from aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousServerSocketChannel.java rename to aio-core/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousServerSocketChannel.java diff --git a/aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousSocketChannel.java b/aio-core/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousSocketChannel.java similarity index 100% rename from aio-enhance/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousSocketChannel.java rename to aio-core/src/main/java/org/smartboot/socket/enhance/EnhanceAsynchronousSocketChannel.java diff --git a/aio-enhance/src/main/java/org/smartboot/socket/enhance/FutureCompletionHandler.java b/aio-core/src/main/java/org/smartboot/socket/enhance/FutureCompletionHandler.java similarity index 100% rename from aio-enhance/src/main/java/org/smartboot/socket/enhance/FutureCompletionHandler.java rename to aio-core/src/main/java/org/smartboot/socket/enhance/FutureCompletionHandler.java diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java index d9f244f2..be92f765 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java @@ -39,7 +39,7 @@ final class IoServerConfig { /** * 当前smart-socket版本号 */ - public static final String VERSION = "v1.5.26"; + public static final String VERSION = "v1.5.27"; /** * 消息体缓存大小,字节 diff --git a/aio-enhance/pom.xml b/aio-enhance/pom.xml deleted file mode 100644 index ae19e706..00000000 --- a/aio-enhance/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - smart-socket-parent - org.smartboot.socket - 1.5.26 - ../smart-socket-parent - - 4.0.0 - - aio-enhance - - \ No newline at end of file diff --git a/aio-pro/pom.xml b/aio-pro/pom.xml index c0e77e4f..aa34ffc4 100644 --- a/aio-pro/pom.xml +++ b/aio-pro/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.5.26 + 1.5.27 ../smart-socket-parent diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 74d33027..b2c53e2e 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -18,7 +18,7 @@ org.smartboot.socket aio-pro - 1.5.26 + 1.5.27 org.slf4j diff --git a/example/pom.xml b/example/pom.xml index 12848674..9bbe14c7 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -23,7 +23,7 @@ org.smartboot.socket aio-pro - 1.5.26 + 1.5.27 org.apache.commons diff --git a/pom.xml b/pom.xml index aff4c7af..5f5dd9a6 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.smartboot.socket smart-socket-parent - 1.5.26 + 1.5.27 2.6 diff --git a/smart-socket-parent/pom.xml b/smart-socket-parent/pom.xml index 1910442d..1ee3049a 100644 --- a/smart-socket-parent/pom.xml +++ b/smart-socket-parent/pom.xml @@ -15,23 +15,18 @@ 4.0.0 org.smartboot.socket smart-socket-parent - 1.5.26 + 1.5.27 pom UTF-8 1.7.36 - 1.5.26 + 1.5.27 4.13.2 - - org.smartboot.socket - aio-enhance - ${aio.version} - org.smartboot.socket aio-core @@ -272,6 +267,5 @@ ../aio-core ../aio-pro - ../aio-enhance \ No newline at end of file -- Gitee From 1c80d70b5c5ff9a96eb8660126d9535f94eae758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Sat, 29 Apr 2023 21:14:36 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=881.5.27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/smartboot/socket/transport/TcpAioSession.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/TcpAioSession.java b/aio-core/src/main/java/org/smartboot/socket/transport/TcpAioSession.java index 04bcb706..2ad0c4ca 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/TcpAioSession.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/TcpAioSession.java @@ -292,8 +292,10 @@ final class TcpAioSession extends AioSession { monitor.afterRead(this, result); } this.eof = result == -1; - this.readBuffer.buffer().flip(); - signalRead(); + if (SESSION_STATUS_CLOSED != status) { + this.readBuffer.buffer().flip(); + signalRead(); + } } /** -- Gitee From f99610d17a6b5f5915e8257a0290a5baf46f4f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Sun, 30 Apr 2023 09:52:03 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=881.6.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio-core/pom.xml | 2 +- .../java/org/smartboot/socket/transport/IoServerConfig.java | 2 +- aio-enhance/pom.xml | 0 aio-pro/pom.xml | 2 +- benchmark/pom.xml | 2 +- example/pom.xml | 2 +- pom.xml | 2 +- smart-socket-parent/pom.xml | 4 ++-- 8 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 aio-enhance/pom.xml diff --git a/aio-core/pom.xml b/aio-core/pom.xml index a405b631..91e24078 100644 --- a/aio-core/pom.xml +++ b/aio-core/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.6.4 + 1.6.5 ../smart-socket-parent diff --git a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java index a5e4f431..4d80ad36 100644 --- a/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java +++ b/aio-core/src/main/java/org/smartboot/socket/transport/IoServerConfig.java @@ -39,7 +39,7 @@ final class IoServerConfig { /** * 当前smart-socket版本号 */ - public static final String VERSION = "v1.6.4"; + public static final String VERSION = "v1.6.5"; /** * 消息体缓存大小,字节 diff --git a/aio-enhance/pom.xml b/aio-enhance/pom.xml deleted file mode 100644 index e69de29b..00000000 diff --git a/aio-pro/pom.xml b/aio-pro/pom.xml index 18c6cca8..e0eb35a3 100644 --- a/aio-pro/pom.xml +++ b/aio-pro/pom.xml @@ -19,7 +19,7 @@ org.smartboot.socket smart-socket-parent - 1.6.4 + 1.6.5 ../smart-socket-parent diff --git a/benchmark/pom.xml b/benchmark/pom.xml index 86acbfae..39e292a6 100644 --- a/benchmark/pom.xml +++ b/benchmark/pom.xml @@ -18,7 +18,7 @@ org.smartboot.socket aio-pro - 1.6.4 + 1.6.5 org.slf4j diff --git a/example/pom.xml b/example/pom.xml index 5cafdfdf..0cbfd9bc 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -23,7 +23,7 @@ org.smartboot.socket aio-pro - 1.6.4 + 1.6.5 org.apache.commons diff --git a/pom.xml b/pom.xml index 00b48f2a..eb1bd730 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.smartboot.socket smart-socket-parent - 1.6.4 + 1.6.5 2.6 diff --git a/smart-socket-parent/pom.xml b/smart-socket-parent/pom.xml index 34ca8ab1..5cf4c4a2 100644 --- a/smart-socket-parent/pom.xml +++ b/smart-socket-parent/pom.xml @@ -15,14 +15,14 @@ 4.0.0 org.smartboot.socket smart-socket-parent - 1.6.4 + 1.6.5 pom UTF-8 1.7.36 - 1.6.4 + 1.6.5 4.13.2 -- Gitee From d4867fbfa1c8da4c3d2816be4329af0aceb566ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=88=80?= Date: Sun, 30 Apr 2023 09:55:34 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=89=881.6.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/smartboot/socket/buffer/BufferPage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java b/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java index ae7db4ea..3d3c5e39 100644 --- a/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java +++ b/aio-core/src/main/java/org/smartboot/socket/buffer/BufferPage.java @@ -10,7 +10,7 @@ package org.smartboot.socket.buffer; -import sun.nio.ch.DirectBuffer; +import sun.misc.Unsafe; import java.nio.ByteBuffer; import java.util.Iterator; @@ -278,7 +278,7 @@ public final class BufferPage { */ void release() { if (buffer.isDirect()) { - ((DirectBuffer) buffer).cleaner().clean(); + Unsafe.getUnsafe().invokeCleaner(buffer); } } -- Gitee