修复client_number计数错误 (#1704)

This commit is contained in:
丁大龙
2023-02-17 14:36:32 +08:00
committed by GitHub
parent 39f3ddbc10
commit f344a49755

View File

@@ -90,6 +90,7 @@ function gateserver.start(handler)
MSG.more = dispatch_queue
function MSG.open(fd, msg)
client_number = client_number + 1
if client_number >= maxclient then
socketdriver.shutdown(fd)
return
@@ -98,7 +99,6 @@ function gateserver.start(handler)
socketdriver.nodelay(fd)
end
connection[fd] = true
client_number = client_number + 1
handler.connect(fd, msg)
end