mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
socket bind
This commit is contained in:
@@ -105,8 +105,8 @@ function socket.open(addr, port)
|
|||||||
return fd
|
return fd
|
||||||
end
|
end
|
||||||
|
|
||||||
function socket.stdin()
|
function socket.bind(sock)
|
||||||
local r = skynet.call(sockets, "text", "bind 1")
|
local r = skynet.call(sockets, "text", "bind " .. tonumber(sock))
|
||||||
if r == "" then
|
if r == "" then
|
||||||
error("stdin bind failed")
|
error("stdin bind failed")
|
||||||
end
|
end
|
||||||
@@ -116,6 +116,10 @@ function socket.stdin()
|
|||||||
return fd
|
return fd
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function socket.stdin()
|
||||||
|
return socket.bind(1)
|
||||||
|
end
|
||||||
|
|
||||||
function socket.close(fd)
|
function socket.close(fd)
|
||||||
socket.lock(fd)
|
socket.lock(fd)
|
||||||
skynet.call(sockets, "text", "close", fd)
|
skynet.call(sockets, "text", "close", fd)
|
||||||
|
|||||||
Reference in New Issue
Block a user