Merge pull request #51 from qq564139153/main

fix[net]:修改sessionId生成的BUG
This commit is contained in:
godotg
2023-03-06 10:23:57 +08:00
committed by GitHub
@@ -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;
}