diff --git a/header.txt b/header.txt
index 172d1ba7..6c4e3ec6 100644
--- a/header.txt
+++ b/header.txt
@@ -1,4 +1,5 @@
-Copyright (c) 2012-2025 Nikita Koksharov
+Copyright (c) 2025 The Socketio4j Project
+Parent project : Copyright (c) 2012-2025 Nikita Koksharov
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckCallback.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckCallback.java
index 2ec71fd7..2cac2d3a 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckCallback.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckCallback.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckMode.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckMode.java
index ba9bc4c8..e819cccb 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckMode.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckMode.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckRequest.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckRequest.java
index b78f071d..256d917e 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckRequest.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AckRequest.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthTokenListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthTokenListener.java
index 86b0342e..9a4246c7 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthTokenListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthTokenListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthTokenResult.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthTokenResult.java
index e14608cc..e550e4b3 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthTokenResult.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthTokenResult.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthorizationListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthorizationListener.java
index 8e6888ea..983be256 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthorizationListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthorizationListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthorizationResult.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthorizationResult.java
index aeeb1581..251582c9 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthorizationResult.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/AuthorizationResult.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BasicConfiguration.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BasicConfiguration.java
index aba41525..5fa26090 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BasicConfiguration.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BasicConfiguration.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,10 +16,12 @@
*/
package com.corundumstudio.socketio;
-
import java.util.Arrays;
import java.util.List;
+import com.corundumstudio.socketio.nativeio.TransportType;
+
+
/**
* Basic configuration class, contains only primitive, String and enum types
* as fields. Used as a base class for Configuration
@@ -31,10 +34,9 @@ public abstract class BasicConfiguration {
protected int bossThreads = 0; // 0 = current_processors_amount * 2
protected int workerThreads = 0; // 0 = current_processors_amount * 2
- protected boolean useLinuxNativeEpoll;
- protected boolean useLinuxNativeIoUring;
- protected boolean useUnixNativeKqueue;
+ protected TransportType transportType = TransportType.AUTO;
+
protected boolean allowCustomRequests = false;
protected int upgradeTimeout = 10000;
@@ -75,9 +77,7 @@ protected BasicConfiguration() {
protected BasicConfiguration(BasicConfiguration conf) {
setBossThreads(conf.getBossThreads());
setWorkerThreads(conf.getWorkerThreads());
- setUseLinuxNativeEpoll(conf.isUseLinuxNativeEpoll());
- setUseLinuxNativeIoUring(conf.isUseLinuxNativeIoUring());
- setUseUnixNativeKqueue(conf.isUseUnixNativeKqueue());
+ setTransportType(conf.getTransportType());
setPingInterval(conf.getPingInterval());
setPingTimeout(conf.getPingTimeout());
setFirstDataTimeout(conf.getFirstDataTimeout());
@@ -353,29 +353,14 @@ public boolean isEnableCors() {
return enableCors;
}
- public boolean isUseLinuxNativeEpoll() {
- return useLinuxNativeEpoll;
+ public TransportType getTransportType() {
+ return transportType;
}
- public void setUseLinuxNativeEpoll(boolean useLinuxNativeEpoll) {
- this.useLinuxNativeEpoll = useLinuxNativeEpoll;
+ public void setTransportType(TransportType transportType) {
+ this.transportType = transportType;
}
- public boolean isUseLinuxNativeIoUring() {
- return useLinuxNativeIoUring;
- }
-
- public void setUseLinuxNativeIoUring(boolean useLinuxNativeIoUring) {
- this.useLinuxNativeIoUring = useLinuxNativeIoUring;
- }
-
- public boolean isUseUnixNativeKqueue() {
- return useUnixNativeKqueue;
- }
-
- public void setUseUnixNativeKqueue(boolean useUnixNativeKqueue) {
- this.useUnixNativeKqueue = useUnixNativeKqueue;
- }
/**
* Set the response Access-Control-Allow-Headers
*
@@ -461,50 +446,4 @@ public boolean isNeedClientAuth() {
return needClientAuth;
}
- /**
- * Validates the native transport configuration.
- *
- * Only one native transport may be enabled at a time. The supported native
- * transports are:
- *
- * - io_uring (Linux)
- * - epoll (Linux)
- * - kqueue (macOS / BSD)
- *
- *
- * This method performs a bitmask-based check to ensure that at most one of the
- * transport flags is enabled. If more than one flag is set, an
- * {@link IllegalArgumentException} is thrown detailing which transports were
- * simultaneously enabled.
- *
- * @throws IllegalArgumentException
- * if more than one native transport is configured at the same time
- */
- public void validate() {
- int bits = 0;
- if (isUseLinuxNativeIoUring()) bits |= 1;
- if (isUseLinuxNativeEpoll()) bits |= 2;
- if (isUseUnixNativeKqueue()) bits |= 4;
-
- if (Integer.bitCount(bits) > 1) {
- throw new IllegalArgumentException(
- "Only one native transport MUST be enabled: " + enabledTransports(bits)
- );
- }
- }
-
-
- private String enabledTransports(int bits) {
- StringBuilder sb = new StringBuilder();
-
- sb.append("[");
- if ((bits & 1) != 0) sb.append("io_uring ");
- if ((bits & 2) != 0) sb.append("epoll ");
- if ((bits & 4) != 0) sb.append("kqueue ");
- sb.append("]");
-
- return sb.toString().trim();
- }
-
-
}
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BroadcastAckCallback.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BroadcastAckCallback.java
index c629b5d5..14a9b7fa 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BroadcastAckCallback.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BroadcastAckCallback.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BroadcastOperations.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BroadcastOperations.java
index 599a94f6..ff39f469 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BroadcastOperations.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/BroadcastOperations.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ClientOperations.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ClientOperations.java
index de612a3b..42ec13da 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ClientOperations.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ClientOperations.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Configuration.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Configuration.java
index 49164cf2..7fee5989 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Configuration.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Configuration.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Disconnectable.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Disconnectable.java
index dcd34f4a..7f9ce0cb 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Disconnectable.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Disconnectable.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/DisconnectableHub.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/DisconnectableHub.java
index 4f426648..a576b455 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/DisconnectableHub.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/DisconnectableHub.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/HandshakeData.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/HandshakeData.java
index c32d84d7..615e5823 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/HandshakeData.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/HandshakeData.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/HttpRequestDecoderConfiguration.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/HttpRequestDecoderConfiguration.java
index 20d25c0d..0210098e 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/HttpRequestDecoderConfiguration.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/HttpRequestDecoderConfiguration.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java
index 640b6c17..32e16372 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/JsonSupportWrapper.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiRoomBroadcastOperations.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiRoomBroadcastOperations.java
index 2aa1e2d0..c55ff96c 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiRoomBroadcastOperations.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiRoomBroadcastOperations.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiTypeAckCallback.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiTypeAckCallback.java
index 0f556057..3d5c005c 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiTypeAckCallback.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiTypeAckCallback.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiTypeArgs.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiTypeArgs.java
index 8f134f21..f4430030 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiTypeArgs.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/MultiTypeArgs.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ServerStatus.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ServerStatus.java
index 90389372..6ab7a28d 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ServerStatus.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ServerStatus.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SingleRoomBroadcastOperations.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SingleRoomBroadcastOperations.java
index f7349308..d75f795b 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SingleRoomBroadcastOperations.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SingleRoomBroadcastOperations.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketConfig.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketConfig.java
index 686767ae..e0b9e873 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketConfig.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketConfig.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOChannelInitializer.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOChannelInitializer.java
index e4dcf195..c142e1eb 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOChannelInitializer.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOChannelInitializer.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOClient.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOClient.java
index 3b842a43..0beffa5f 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOClient.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOClient.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIONamespace.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIONamespace.java
index a28cfcfd..523661c4 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIONamespace.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIONamespace.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOServer.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOServer.java
index 16927582..233579af 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOServer.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketIOServer.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,16 +23,6 @@
import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
-import io.netty.channel.*;
-import io.netty.channel.epoll.Epoll;
-import io.netty.channel.epoll.EpollIoHandler;
-import io.netty.channel.kqueue.KQueue;
-import io.netty.channel.kqueue.KQueueIoHandler;
-import io.netty.channel.kqueue.KQueueServerSocketChannel;
-import io.netty.channel.nio.NioIoHandler;
-import io.netty.channel.uring.IoUring;
-import io.netty.channel.uring.IoUringIoHandler;
-import io.netty.channel.uring.IoUringServerSocketChannel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -47,21 +38,29 @@
import com.corundumstudio.socketio.namespace.NamespacesHub;
import io.netty.bootstrap.ServerBootstrap;
-import io.netty.channel.epoll.EpollServerSocketChannel;
+import io.netty.channel.ChannelOption;
+import io.netty.channel.DefaultEventLoop;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.FixedRecvByteBufAllocator;
+import io.netty.channel.IoHandlerFactory;
+import io.netty.channel.MultiThreadIoEventLoopGroup;
+import io.netty.channel.ServerChannel;
+import io.netty.channel.WriteBufferWaterMark;
+import io.netty.channel.nio.NioIoHandler;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener;
import io.netty.util.concurrent.SucceededFuture;
+
/**
* Fully thread-safe.
- *
*/
public class SocketIOServer implements ClientListeners {
private static final Logger log = LoggerFactory.getLogger(SocketIOServer.class);
- private final AtomicReference serverStatus = new AtomicReference(ServerStatus.INIT);
+ private final AtomicReference serverStatus = new AtomicReference<>(ServerStatus.INIT);
private final Configuration configCopy;
private final Configuration configuration;
@@ -85,30 +84,14 @@ public void setPipelineFactory(SocketIOChannelInitializer pipelineFactory) {
this.pipelineFactory = pipelineFactory;
}
- /**
- * Get all clients connected to default namespace
- *
- * @return clients collection
- */
public Collection getAllClients() {
return namespacesHub.get(Namespace.DEFAULT_NAME).getAllClients();
}
- /**
- * Get client by uuid from default namespace
- *
- * @param uuid - id of client
- * @return client
- */
public SocketIOClient getClient(UUID uuid) {
return namespacesHub.get(Namespace.DEFAULT_NAME).getClient(uuid);
}
- /**
- * Get all namespaces
- *
- * @return namespaces collection
- */
public Collection getAllNamespaces() {
return namespacesHub.getAllNamespaces();
}
@@ -116,123 +99,159 @@ public Collection getAllNamespaces() {
public BroadcastOperations getBroadcastOperations() {
Collection namespaces = namespacesHub.getAllNamespaces();
List list = new ArrayList<>();
- BroadcastOperations broadcast = null;
- if (namespaces != null && !namespaces.isEmpty()) {
+ if (namespaces != null) {
for (SocketIONamespace n : namespaces) {
- broadcast = n.getBroadcastOperations();
- list.add(broadcast);
+ list.add(n.getBroadcastOperations());
}
}
return new MultiRoomBroadcastOperations(list);
}
- /**
- * Get broadcast operations for clients within
- * rooms by rooms' names
- *
- * @param rooms rooms' names
- * @return broadcast operations
- */
public BroadcastOperations getRoomOperations(String... rooms) {
Collection namespaces = namespacesHub.getAllNamespaces();
- List list = new ArrayList();
- BroadcastOperations broadcast = null;
- if (namespaces != null && !namespaces.isEmpty()) {
+ List list = new ArrayList<>();
+ if (namespaces != null) {
for (SocketIONamespace n : namespaces) {
for (String room : rooms) {
- broadcast = n.getRoomOperations(room);
- list.add(broadcast);
+ list.add(n.getRoomOperations(room));
}
}
}
return new MultiRoomBroadcastOperations(list);
}
- /**
- * Start server
- */
public void start() {
startAsync().syncUninterruptibly();
}
- /**
- * Returns true if server is started
- */
public boolean isStarted() {
return serverStatus.get() == ServerStatus.STARTED;
}
- /**
- * Start server asynchronously
- *
- * @return void
- */
public Future startAsync() {
if (!serverStatus.compareAndSet(ServerStatus.INIT, ServerStatus.STARTING)) {
- log.warn("Invalid server state: {}, should be: {}, ignoring start request", serverStatus.get(), ServerStatus.INIT);
- return new SucceededFuture(new DefaultEventLoop(), null);
+ log.warn("Invalid server state: {}, should be: {}, ignoring start request",
+ serverStatus.get(), ServerStatus.INIT);
+ return new SucceededFuture<>(new DefaultEventLoop(), null);
}
try {
- log.info("Session store / pubsub factory used: {}", configCopy.getStoreFactory());
+ log.info("Session store / pubsub factory: {}", configCopy.getStoreFactory());
initGroups();
-
pipelineFactory.start(configCopy, namespacesHub);
- configCopy.validate();
+ Class extends ServerChannel> channelClass;
- Class extends ServerChannel> channelClass = NioServerSocketChannel.class;
+ switch (configCopy.getTransportType()) {
- if (configCopy.isUseLinuxNativeIoUring() && IoUring.isAvailable()) {
- channelClass = IoUringServerSocketChannel.class;
- } else if (configCopy.isUseLinuxNativeEpoll() && Epoll.isAvailable()) {
- channelClass = EpollServerSocketChannel.class;
- } else if (configCopy.isUseUnixNativeKqueue() && KQueue.isAvailable()) {
- channelClass = KQueueServerSocketChannel.class;
- } else {
- log.warn("No selected native transport is available. Falling back to NIO");
- }
+ case IO_URING:
+ if (ioUringAvailable()) {
+ channelClass = loadChannelClass("io.netty.channel.uring.IoUringServerSocketChannel");
+ } else {
+ channelClass = fallback("IO_URING unavailable");
+ }
+ break;
+ case EPOLL:
+ if (epollAvailable()) {
+ channelClass = loadChannelClass("io.netty.channel.epoll.EpollServerSocketChannel");
+ } else {
+ channelClass = fallback("EPOLL unavailable");
+ }
+ break;
- ServerBootstrap b = new ServerBootstrap();
- b.group(bossGroup, workerGroup)
+ case KQUEUE:
+ if (kqueueAvailable()) {
+ channelClass = loadChannelClass("io.netty.channel.kqueue.KQueueServerSocketChannel");
+ } else {
+ channelClass = fallback("KQUEUE unavailable");
+ }
+ break;
+
+ case NIO:
+ channelClass = NioServerSocketChannel.class;
+ break;
+
+ case AUTO:
+ default:
+ if (ioUringAvailable()) {
+ channelClass = loadChannelClass("io.netty.channel.uring.IoUringServerSocketChannel");
+ log.info("AUTO selected IO_URING transport");
+ } else if (epollAvailable()) {
+ channelClass = loadChannelClass("io.netty.channel.epoll.EpollServerSocketChannel");
+ log.info("AUTO selected EPOLL transport");
+ } else if (kqueueAvailable()) {
+ channelClass = loadChannelClass("io.netty.channel.kqueue.KQueueServerSocketChannel");
+ log.info("AUTO selected KQUEUE transport");
+ } else {
+ channelClass = NioServerSocketChannel.class;
+ log.info("AUTO selected NIO transport");
+ }
+ }
+
+ ServerBootstrap bootstrap = new ServerBootstrap();
+ bootstrap.group(bossGroup, workerGroup)
.channel(channelClass)
.childHandler(pipelineFactory);
- applyConnectionOptions(b);
- InetSocketAddress addr = new InetSocketAddress(configCopy.getPort());
- if (configCopy.getHostname() != null) {
- addr = new InetSocketAddress(configCopy.getHostname(), configCopy.getPort());
+ applyConnectionOptions(bootstrap);
+
+ InetSocketAddress address;
+ if (configCopy.getHostname() == null) {
+ address = new InetSocketAddress(configCopy.getPort());
+ } else {
+ address = new InetSocketAddress(configCopy.getHostname(), configCopy.getPort());
}
- return b.bind(addr).addListener(new FutureListener() {
- @Override
- public void operationComplete(Future future) throws Exception {
- if (future.isSuccess()) {
- serverStatus.set(ServerStatus.STARTED);
- log.info("SocketIO server started at port: {}", configCopy.getPort());
- } else {
- serverStatus.set(ServerStatus.INIT);
- log.error("SocketIO server start failed at port: {}!", configCopy.getPort());
- }
+ return bootstrap.bind(address).addListener((FutureListener) future -> {
+ if (future.isSuccess()) {
+ serverStatus.set(ServerStatus.STARTED);
+ log.info("SocketIO server started on port {}", configCopy.getPort());
+ } else {
+ serverStatus.set(ServerStatus.INIT);
+ log.error("Failed to start server on port {}", configCopy.getPort());
}
});
+
} catch (Exception e) {
serverStatus.set(ServerStatus.INIT);
- log.error("SocketIO server start error at port: {}! {}", configCopy.getPort(), e.getMessage(), e);
+ log.error("Server start error on port {}: {}", configCopy.getPort(), e.getMessage(), e);
throw e;
}
}
+ private Class extends ServerChannel> loadChannelClass(String name) {
+ try {
+ @SuppressWarnings("unchecked")
+ Class extends ServerChannel> c = (Class extends ServerChannel>) Class.forName(name);
+ return c;
+ } catch (Exception ignored) {
+ log.warn("Unable to load native channel {}. Using NIO.", name);
+ return NioServerSocketChannel.class;
+ }
+ }
+
+ private Class extends ServerChannel> fallback(String msg) {
+ log.warn("{} → Falling back to NIO.", msg);
+ return NioServerSocketChannel.class;
+ }
+
+ private IoHandlerFactory fallbackFactory(String msg) {
+ log.warn("{} → Falling back to NIO IoHandler.", msg);
+ return NioIoHandler.newFactory();
+ }
+
protected void applyConnectionOptions(ServerBootstrap bootstrap) {
SocketConfig config = configCopy.getSocketConfig();
+
bootstrap.childOption(ChannelOption.TCP_NODELAY, config.isTcpNoDelay());
+
if (config.getTcpSendBufferSize() != -1) {
bootstrap.childOption(ChannelOption.SO_SNDBUF, config.getTcpSendBufferSize());
}
if (config.getTcpReceiveBufferSize() != -1) {
bootstrap.childOption(ChannelOption.SO_RCVBUF, config.getTcpReceiveBufferSize());
- bootstrap.childOption(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(config.getTcpReceiveBufferSize()));
+ bootstrap.childOption(ChannelOption.RECVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(config.getTcpReceiveBufferSize()));
}
//default value @see WriteBufferWaterMark.DEFAULT
if (config.getWriteBufferWaterMarkLow() != -1 && config.getWriteBufferWaterMarkHigh() != -1) {
@@ -250,33 +269,62 @@ protected void applyConnectionOptions(ServerBootstrap bootstrap) {
protected void initGroups() {
- configCopy.validate();
+ IoHandlerFactory handler;
+
+ switch (configCopy.getTransportType()) {
+
+ case IO_URING:
+ handler = createHandler("io.netty.channel.uring.IoUringIoHandler", ioUringAvailable());
+ break;
+
+ case EPOLL:
+ handler = createHandler("io.netty.channel.epoll.EpollIoHandler", epollAvailable());
+ break;
- IoHandlerFactory ioHandler = NioIoHandler.newFactory(); // default
+ case KQUEUE:
+ handler = createHandler("io.netty.channel.kqueue.KQueueIoHandler", kqueueAvailable());
+ break;
- if (configCopy.isUseLinuxNativeIoUring() && IoUring.isAvailable()) {
- ioHandler = IoUringIoHandler.newFactory();
- } else if (configCopy.isUseLinuxNativeEpoll() && Epoll.isAvailable()) {
- ioHandler = EpollIoHandler.newFactory();
- } else if (configCopy.isUseUnixNativeKqueue() && KQueue.isAvailable()) {
- ioHandler = KQueueIoHandler.newFactory();
+ case NIO:
+ handler = NioIoHandler.newFactory();
+ break;
+
+ case AUTO:
+ default:
+ if (ioUringAvailable()) {
+ handler = createHandler("io.netty.channel.uring.IoUringIoHandler", true);
+ } else if (epollAvailable()) {
+ handler = createHandler("io.netty.channel.epoll.EpollIoHandler", true);
+ } else if (kqueueAvailable()) {
+ handler = createHandler("io.netty.channel.kqueue.KQueueIoHandler", true);
+ } else {
+ handler = fallbackFactory("No native transport available.");
+ }
}
- bossGroup = new MultiThreadIoEventLoopGroup(configCopy.getBossThreads(), ioHandler);
- workerGroup = new MultiThreadIoEventLoopGroup(configCopy.getWorkerThreads(), ioHandler);
+ bossGroup = new MultiThreadIoEventLoopGroup(configCopy.getBossThreads(), handler);
+ workerGroup = new MultiThreadIoEventLoopGroup(configCopy.getWorkerThreads(), handler);
+ }
+ private IoHandlerFactory createHandler(String className, boolean available) {
+ if (!available) {
+ return fallbackFactory(className + " unavailable");
+ }
+ try {
+ return (IoHandlerFactory) Class.forName(className)
+ .getMethod("newFactory")
+ .invoke(null);
+ } catch (Exception ignored) {
+ return fallbackFactory("Failed to load " + className);
+ }
}
- /**
- * Stop server
- */
public void stop() {
if (!serverStatus.compareAndSet(ServerStatus.STARTED, ServerStatus.STOPPING)) {
- log.warn("Invalid server state: {}, should be: {}, ignoring stop request", serverStatus.get(), ServerStatus.STARTED);
+ log.warn("Invalid server state {}, ignoring stop()", serverStatus.get());
return;
}
try {
- log.info("Stopping SocketIO server...");
bossGroup.shutdownGracefully().syncUninterruptibly();
workerGroup.shutdownGracefully().syncUninterruptibly();
pipelineFactory.stop();
@@ -298,13 +346,6 @@ public void removeNamespace(String name) {
namespacesHub.remove(name);
}
- /**
- * Allows to get configuration provided
- * during server creation. Further changes on
- * this object not affect server.
- *
- * @return Configuration object
- */
public Configuration getConfiguration() {
return configuration;
}
@@ -325,7 +366,6 @@ public void addEventInterceptor(EventInterceptor eventInterceptor) {
}
-
@Override
public void removeAllListeners(String eventName) {
mainNamespace.removeAllListeners(eventName);
@@ -362,9 +402,45 @@ public void addListeners(Iterable listeners) {
}
@Override
- public void addListeners(Object listeners, Class> listenersClass) {
- mainNamespace.addListeners(listeners, listenersClass);
+ public void addListeners(Object listeners, Class> clazz) {
+ mainNamespace.addListeners(listeners, clazz);
}
+ /* ---------------------------------------------------------------------
+ * Native Transport Detection — Safe Reflection
+ * --------------------------------------------------------------------- */
+
+ private static boolean isClassPresent(String name) {
+ try {
+ Class.forName(name, false, SocketIOServer.class.getClassLoader());
+ return true;
+ } catch (Exception ignored) {
+ return false;
+ }
+ }
+
+ private static boolean isNativeAvailable(String className, String method) {
+ try {
+ Class> cls = Class.forName(className, false, SocketIOServer.class.getClassLoader());
+ return (Boolean) cls.getMethod(method).invoke(null);
+ } catch (Exception ignored) {
+ return false;
+ }
+ }
+
+ private static boolean ioUringAvailable() {
+ return isClassPresent("io.netty.channel.uring.IoUring")
+ && isNativeAvailable("io.netty.channel.uring.IoUring", "isAvailable");
+ }
+
+ private static boolean epollAvailable() {
+ return isClassPresent("io.netty.channel.epoll.Epoll")
+ && isNativeAvailable("io.netty.channel.epoll.Epoll", "isAvailable");
+ }
+
+ private static boolean kqueueAvailable() {
+ return isClassPresent("io.netty.channel.kqueue.KQueue")
+ && isNativeAvailable("io.netty.channel.kqueue.KQueue", "isAvailable");
+ }
}
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketSslConfig.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketSslConfig.java
index f905176e..30e19ba2 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketSslConfig.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/SocketSslConfig.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Transport.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Transport.java
index 7bb3ed99..6fe13948 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Transport.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/Transport.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/VoidAckCallback.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/VoidAckCallback.java
index 6791b525..5a024da5 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/VoidAckCallback.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/VoidAckCallback.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ack/AckManager.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ack/AckManager.java
index 26a52cb4..8dd4b54f 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ack/AckManager.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ack/AckManager.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +20,7 @@
import java.util.Map;
import java.util.Set;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
@@ -37,13 +39,11 @@
import com.corundumstudio.socketio.scheduler.SchedulerKey;
import com.corundumstudio.socketio.scheduler.SchedulerKey.Type;
-import io.netty.util.internal.PlatformDependent;
-
public class AckManager implements Disconnectable {
static class AckEntry {
- final Map> ackCallbacks = PlatformDependent.newConcurrentHashMap();
+ final Map> ackCallbacks = new ConcurrentHashMap<>();
final AtomicLong ackIndex = new AtomicLong(-1);
public long addAckCallback(AckCallback> callback) {
@@ -72,7 +72,7 @@ public void initAckIndex(long index) {
private static final Logger log = LoggerFactory.getLogger(AckManager.class);
- private final ConcurrentMap ackEntries = PlatformDependent.newConcurrentHashMap();
+ private final ConcurrentMap ackEntries = new ConcurrentHashMap<>();
private final CancelableScheduler scheduler;
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ack/AckSchedulerKey.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ack/AckSchedulerKey.java
index b9992d08..3afc96fa 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ack/AckSchedulerKey.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/ack/AckSchedulerKey.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/AnnotationScanner.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/AnnotationScanner.java
index 271cfef7..15dcfa12 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/AnnotationScanner.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/AnnotationScanner.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnConnect.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnConnect.java
index 9f966c81..eb86b89c 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnConnect.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnConnect.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnConnectScanner.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnConnectScanner.java
index 1f66c2bd..69e72a05 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnConnectScanner.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnConnectScanner.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnDisconnect.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnDisconnect.java
index 7a1ce2cd..7af9ad85 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnDisconnect.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnDisconnect.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnDisconnectScanner.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnDisconnectScanner.java
index c32840fe..5b83b9d4 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnDisconnectScanner.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnDisconnectScanner.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnEvent.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnEvent.java
index 41d48225..cf04f615 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnEvent.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnEvent.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnEventScanner.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnEventScanner.java
index c3d372fb..f1835ba1 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnEventScanner.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/OnEventScanner.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/ScannerEngine.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/ScannerEngine.java
index 99083f57..e7f717db 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/ScannerEngine.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/annotation/ScannerEngine.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/AuthorizeHandler.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/AuthorizeHandler.java
index 8586a2f8..d2ac24ea 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/AuthorizeHandler.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/AuthorizeHandler.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/ClientHead.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/ClientHead.java
index 6ae4db0c..6fac2dbf 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/ClientHead.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/ClientHead.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +25,7 @@
import java.util.Queue;
import java.util.Set;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -52,7 +54,6 @@
import io.netty.channel.ChannelFutureListener;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.util.AttributeKey;
-import io.netty.util.internal.PlatformDependent;
public class ClientHead {
@@ -61,7 +62,7 @@ public class ClientHead {
public static final AttributeKey CLIENT = AttributeKey.valueOf("client");
private final AtomicBoolean disconnected = new AtomicBoolean();
- private final Map namespaceClients = PlatformDependent.newConcurrentHashMap();
+ private final Map namespaceClients = new ConcurrentHashMap<>();
private final Map channels = new HashMap(2);
private final HandshakeData handshakeData;
private final UUID sessionId;
@@ -124,7 +125,7 @@ public void releasePollingChannel(Channel channel) {
clientsBox.remove(channel);
state.update(null);
}
- } catch (Throwable e) {
+ } catch (Exception e) {
log.error("Failed to release polling channel for session: {}", sessionId, e);
}
}
@@ -141,7 +142,7 @@ public void cancelPing() {
try {
SchedulerKey key = new SchedulerKey(Type.PING, sessionId);
scheduler.cancel(key);
- } catch (Throwable e) {
+ } catch (Exception e) {
log.error("Failed to cancel ping task for session: {}", sessionId, e);
}
}
@@ -149,7 +150,7 @@ public void cancelPingTimeout() {
try {
SchedulerKey key = new SchedulerKey(Type.PING_TIMEOUT, sessionId);
scheduler.cancel(key);
- } catch (Throwable e) {
+ } catch (Exception e) {
log.error("Failed to cancel ping timeout task for session: {}", sessionId, e);
}
}
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/ClientsBox.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/ClientsBox.java
index c47e3beb..fd58ff73 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/ClientsBox.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/ClientsBox.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,16 +18,16 @@
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
import com.corundumstudio.socketio.HandshakeData;
import io.netty.channel.Channel;
-import io.netty.util.internal.PlatformDependent;
public class ClientsBox {
- private final Map uuid2clients = PlatformDependent.newConcurrentHashMap();
- private final Map channel2clients = PlatformDependent.newConcurrentHashMap();
+ private final Map uuid2clients = new ConcurrentHashMap<>();
+ private final Map channel2clients = new ConcurrentHashMap<>();
// TODO use storeFactory
public HandshakeData getHandshakeData(UUID sessionId) {
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/EncoderHandler.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/EncoderHandler.java
index 0e3af311..f4b276a3 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/EncoderHandler.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/EncoderHandler.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/InPacketHandler.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/InPacketHandler.java
index d408834e..071157cb 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/InPacketHandler.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/InPacketHandler.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/PacketListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/PacketListener.java
index 38e87c54..21dede08 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/PacketListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/PacketListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/SocketIOException.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/SocketIOException.java
index 29c46116..a3bd1900 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/SocketIOException.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/SocketIOException.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/SuccessAuthorizationListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/SuccessAuthorizationListener.java
index 8eb8bde4..ebf5bb84 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/SuccessAuthorizationListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/SuccessAuthorizationListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/TransportState.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/TransportState.java
index 6596cac8..4e5ae5c5 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/TransportState.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/TransportState.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/WrongUrlHandler.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/WrongUrlHandler.java
index a1eda30b..0d23d65d 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/WrongUrlHandler.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/handler/WrongUrlHandler.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ClientListeners.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ClientListeners.java
index 98a328bc..a3d6c0b6 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ClientListeners.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ClientListeners.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ConnectListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ConnectListener.java
index 407fb3f0..87b29dd1 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ConnectListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ConnectListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DataListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DataListener.java
index 345d3c6a..478ee717 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DataListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DataListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DefaultExceptionListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DefaultExceptionListener.java
index 6a58eaf1..88c5ba1c 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DefaultExceptionListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DefaultExceptionListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DisconnectListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DisconnectListener.java
index 2cee37b1..686e4c52 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DisconnectListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/DisconnectListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/EventInterceptor.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/EventInterceptor.java
index c6934627..891337d3 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/EventInterceptor.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/EventInterceptor.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ExceptionListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ExceptionListener.java
index cf6fa5d6..d29893f8 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ExceptionListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ExceptionListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ExceptionListenerAdapter.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ExceptionListenerAdapter.java
index 29fa750d..511152fd 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ExceptionListenerAdapter.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/ExceptionListenerAdapter.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/MultiTypeEventListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/MultiTypeEventListener.java
index 84c0b2ef..b9fd0167 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/MultiTypeEventListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/MultiTypeEventListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/PingListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/PingListener.java
index 3a4ffd04..0a3cac7b 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/PingListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/PingListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/PongListener.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/PongListener.java
index 6e065a2d..a1c6d02d 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/PongListener.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/listener/PongListener.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/HttpErrorMessage.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/HttpErrorMessage.java
index c6bfcd0e..bd8b143f 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/HttpErrorMessage.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/HttpErrorMessage.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/HttpMessage.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/HttpMessage.java
index fc80742a..6ee6fd07 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/HttpMessage.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/HttpMessage.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/OutPacketMessage.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/OutPacketMessage.java
index ef94d31b..8701bcfb 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/OutPacketMessage.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/OutPacketMessage.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/PacketsMessage.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/PacketsMessage.java
index 22a78e31..2484811c 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/PacketsMessage.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/PacketsMessage.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/XHROptionsMessage.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/XHROptionsMessage.java
index 7701b1e0..e0541c10 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/XHROptionsMessage.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/XHROptionsMessage.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/XHRPostMessage.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/XHRPostMessage.java
index d4aa008a..c7256970 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/XHRPostMessage.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/messages/XHRPostMessage.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/CompositeIterable.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/CompositeIterable.java
index d3175a25..e6576a71 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/CompositeIterable.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/CompositeIterable.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/CompositeIterator.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/CompositeIterator.java
index 26b2dce4..29a086a2 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/CompositeIterator.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/CompositeIterator.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/IterableCollection.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/IterableCollection.java
index e3ec5d4f..5fe255c5 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/IterableCollection.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/misc/IterableCollection.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/EventEntry.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/EventEntry.java
index 581335e8..475c41e4 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/EventEntry.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/EventEntry.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java
index 4649bfe9..b5caabeb 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,9 +25,13 @@
import java.util.Queue;
import java.util.Set;
import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ConcurrentMap;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import com.corundumstudio.socketio.AckMode;
import com.corundumstudio.socketio.AckRequest;
import com.corundumstudio.socketio.AuthTokenListener;
@@ -55,9 +60,6 @@
import com.corundumstudio.socketio.store.pubsub.PubSubType;
import com.corundumstudio.socketio.transport.NamespaceClient;
-import io.netty.util.internal.PlatformDependent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* Hub object for all clients in one namespace.
@@ -72,7 +74,7 @@ public class Namespace implements SocketIONamespace {
public static final String DEFAULT_NAME = "";
private final ScannerEngine engine = new ScannerEngine();
- private final ConcurrentMap> eventListeners = PlatformDependent.newConcurrentHashMap();
+ private final ConcurrentMap> eventListeners = new ConcurrentHashMap<>();
private final Queue connectListeners = new ConcurrentLinkedQueue();
private final Queue disconnectListeners = new ConcurrentLinkedQueue();
private final Queue pingListeners = new ConcurrentLinkedQueue();
@@ -81,9 +83,9 @@ public class Namespace implements SocketIONamespace {
private final Queue authDataInterceptors = new ConcurrentLinkedQueue<>();
- private final Map allClients = PlatformDependent.newConcurrentHashMap();
- private final ConcurrentMap> roomClients = PlatformDependent.newConcurrentHashMap();
- private final ConcurrentMap> clientRooms = PlatformDependent.newConcurrentHashMap();
+ private final Map allClients = new ConcurrentHashMap<>();
+ private final ConcurrentMap> roomClients = new ConcurrentHashMap<>();
+ private final ConcurrentMap> clientRooms = new ConcurrentHashMap<>();
private final String name;
private final AckMode ackMode;
@@ -374,7 +376,7 @@ public void dispatch(String room, Packet packet) {
private void join(ConcurrentMap> map, K key, V value) {
Set clients = map.get(key);
if (clients == null) {
- clients = Collections.newSetFromMap(PlatformDependent.newConcurrentHashMap());
+ clients = Collections.newSetFromMap(new ConcurrentHashMap<>());
Set oldClients = map.putIfAbsent(key, clients);
if (oldClients != null) {
clients = oldClients;
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/NamespacesHub.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/NamespacesHub.java
index c0c8d1e4..76671a6a 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/NamespacesHub.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/namespace/NamespacesHub.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +19,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.corundumstudio.socketio.Configuration;
@@ -25,11 +27,9 @@
import com.corundumstudio.socketio.SocketIONamespace;
import com.corundumstudio.socketio.misc.CompositeIterable;
-import io.netty.util.internal.PlatformDependent;
-
public class NamespacesHub {
- private final ConcurrentMap namespaces = PlatformDependent.newConcurrentHashMap();
+ private final ConcurrentMap namespaces = new ConcurrentHashMap<>();
private final Configuration configuration;
public NamespacesHub(Configuration configuration) {
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/nativeio/TransportType.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/nativeio/TransportType.java
new file mode 100644
index 00000000..b247fced
--- /dev/null
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/nativeio/TransportType.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.corundumstudio.socketio.nativeio;
+
+public enum TransportType {
+ AUTO, // select the best available, io_uring -> epoll -> kqueue -> nio
+ NIO, // JVM default
+ EPOLL, // Linux
+ KQUEUE, // BSD / macOS
+ IO_URING; // Linux 5.1+, recommended production version 5.15+ (LTS)
+}
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/AckArgs.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/AckArgs.java
index 7198730c..d6ae6eaf 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/AckArgs.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/AckArgs.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/AuthPacket.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/AuthPacket.java
index 78b81351..7398b20e 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/AuthPacket.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/AuthPacket.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/ConnPacket.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/ConnPacket.java
index b3acabd7..245ed243 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/ConnPacket.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/ConnPacket.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/EngineIOVersion.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/EngineIOVersion.java
index 1fc92f82..676943b4 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/EngineIOVersion.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/EngineIOVersion.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/Event.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/Event.java
index d88add4d..36aad393 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/Event.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/Event.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/JacksonJsonSupport.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/JacksonJsonSupport.java
index 97d97cd0..6495bf56 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/JacksonJsonSupport.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/JacksonJsonSupport.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +27,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -64,7 +66,6 @@
import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
-import io.netty.util.internal.PlatformDependent;
public class JacksonJsonSupport implements JsonSupport {
@@ -166,7 +167,7 @@ protected class EventDeserializer extends StdDeserializer {
private static final long serialVersionUID = 8178797221017768689L;
- final Map>> eventMapping = PlatformDependent.newConcurrentHashMap();
+ final Map>> eventMapping = new ConcurrentHashMap<>();
protected EventDeserializer() {
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/JsonSupport.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/JsonSupport.java
index ae85b090..2a31a68c 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/JsonSupport.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/JsonSupport.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/Packet.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/Packet.java
index a0c017fc..bb04950b 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/Packet.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/Packet.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketDecoder.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketDecoder.java
index f2a46481..09e52ef1 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketDecoder.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketDecoder.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketEncoder.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketEncoder.java
index 551bab63..205e79e3 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketEncoder.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketEncoder.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketType.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketType.java
index 393d8021..2586058d 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketType.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/PacketType.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/UTF8CharsScanner.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/UTF8CharsScanner.java
index 9dcd41d4..48773611 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/UTF8CharsScanner.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/protocol/UTF8CharsScanner.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/CancelableScheduler.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/CancelableScheduler.java
index fbbdb7ba..f6635f54 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/CancelableScheduler.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/CancelableScheduler.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/HashedWheelScheduler.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/HashedWheelScheduler.java
index 6afe4ca3..0d220db2 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/HashedWheelScheduler.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/HashedWheelScheduler.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +17,7 @@
package com.corundumstudio.socketio.scheduler;
import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
@@ -23,11 +25,10 @@
import io.netty.util.HashedWheelTimer;
import io.netty.util.Timeout;
import io.netty.util.TimerTask;
-import io.netty.util.internal.PlatformDependent;
public class HashedWheelScheduler implements CancelableScheduler {
- private final Map scheduledFutures = PlatformDependent.newConcurrentHashMap();
+ private final Map scheduledFutures = new ConcurrentHashMap<>();
private final HashedWheelTimer executorService;
public HashedWheelScheduler() {
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/HashedWheelTimeoutScheduler.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/HashedWheelTimeoutScheduler.java
index 436505cf..ae8c8168 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/HashedWheelTimeoutScheduler.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/HashedWheelTimeoutScheduler.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +25,7 @@
package com.corundumstudio.socketio.scheduler;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
@@ -32,11 +34,10 @@
import io.netty.util.HashedWheelTimer;
import io.netty.util.Timeout;
import io.netty.util.TimerTask;
-import io.netty.util.internal.PlatformDependent;
public class HashedWheelTimeoutScheduler implements CancelableScheduler {
- private final ConcurrentMap scheduledFutures = PlatformDependent.newConcurrentHashMap();
+ private final ConcurrentMap scheduledFutures = new ConcurrentHashMap<>();
private final HashedWheelTimer executorService;
private volatile ChannelHandlerContext ctx;
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/SchedulerKey.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/SchedulerKey.java
index e097b490..256ae43f 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/SchedulerKey.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/scheduler/SchedulerKey.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/store/HazelcastPubSubStore.java b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/store/HazelcastPubSubStore.java
index 035b0b42..9bde63f1 100644
--- a/netty-socketio-core/src/main/java/com/corundumstudio/socketio/store/HazelcastPubSubStore.java
+++ b/netty-socketio-core/src/main/java/com/corundumstudio/socketio/store/HazelcastPubSubStore.java
@@ -1,5 +1,6 @@
/**
- * Copyright (c) 2012-2025 Nikita Koksharov
+ * Copyright (c) 2025 The Socketio4j Project
+ * Parent project : Copyright (c) 2012-2025 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,9 +17,11 @@
package com.corundumstudio.socketio.store;
import java.util.Queue;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ConcurrentMap;
-import java.util.UUID;
+
import com.corundumstudio.socketio.store.pubsub.PubSubListener;
import com.corundumstudio.socketio.store.pubsub.PubSubMessage;
import com.corundumstudio.socketio.store.pubsub.PubSubStore;
@@ -27,16 +30,13 @@
import com.hazelcast.topic.ITopic;
-import io.netty.util.internal.PlatformDependent;
-
-
public class HazelcastPubSubStore implements PubSubStore {
private final HazelcastInstance hazelcastPub;
private final HazelcastInstance hazelcastSub;
private final Long nodeId;
- private final ConcurrentMap> map = PlatformDependent.newConcurrentHashMap();
+ private final ConcurrentMap> map = new ConcurrentHashMap<>();
public HazelcastPubSubStore(HazelcastInstance hazelcastPub, HazelcastInstance hazelcastSub, Long nodeId) {
this.hazelcastPub = hazelcastPub;
@@ -76,6 +76,9 @@ public void subscribe(PubSubType type, final PubSubLis
public void unsubscribe(PubSubType type) {
String name = type.toString();
Queue regIds = map.remove(name);
+ if (regIds == null || regIds.isEmpty()) {
+ return;
+ }
ITopic