Update the return values of socket.listen, also return the real port bind to zero (#1638)

This commit is contained in:
zaxbbun
2022-09-03 07:19:03 +08:00
committed by GitHub
parent 6bd6f53ab8
commit c1eeba215d
10 changed files with 30 additions and 18 deletions

View File

@@ -41,10 +41,10 @@ function gateserver.start(handler)
maxclient = conf.maxclient or 1024
nodelay = conf.nodelay
skynet.error(string.format("Listen on %s:%d", address, port))
socket = socketdriver.listen(address, port)
socket, port = socketdriver.listen(address, port)
socketdriver.start(socket)
if handler.open then
return handler.open(source, conf)
return handler.open(source, conf, port)
end
end