socket.listen returns addr,port

This commit is contained in:
Cloud Wu
2022-09-04 00:13:49 +08:00
parent 800a3376d6
commit c8197328a4
5 changed files with 43 additions and 10 deletions

View File

@@ -263,11 +263,8 @@ skynet.start(function()
end
end)
skynet.wait()
socket.close(slave_fd)
else
-- slave_fd does not start, so use close_fd.
socket.close_fd(slave_fd)
end
socket.close(slave_fd)
skynet.error("Shakehand ready")
skynet.fork(ready)
end)

View File

@@ -118,7 +118,7 @@ local function console_main_loop(stdin, print, addr)
end
skynet.start(function()
local listen_socket = socket.listen (ip, port)
local listen_socket, ip, port = socket.listen (ip, port)
skynet.error("Start debug console at " .. ip .. ":" .. port)
socket.start(listen_socket , function(id, addr)
local function print(...)