mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-10 22:25:25 +00:00
Merge pull request #51 from qq564139153/main
fix[net]:修改sessionId生成的BUG
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user