Merge pull request #51 from qq564139153/main

fix[net]:修改sessionId生成的BUG
This commit is contained in:
godotg authored and GitHub committed 2023-03-06 10:23:57 +08:00
commit 166d4a4115
1 file changed
+4 -1
@@ -50,7 +50,10 @@ public class Session implements Closeable {
if (channel == null) {
throw new IllegalArgumentException("channel cannot be empty");
}
this.sid = ATOMIC_LONG.getAndIncrement();
this.sid = ATOMIC_LONG.incrementAndGet();
if (this.sid <= 0) {
throw new IllegalArgumentException("sid cannot be 0");
}
this.channel = channel;
}