summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
Diffstat (limited to 'xmake')
-rw-r--r--xmake/core/base/poller.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/xmake/core/base/poller.lua b/xmake/core/base/poller.lua
index f853c3c92..8ad0026d0 100644
--- a/xmake/core/base/poller.lua
+++ b/xmake/core/base/poller.lua
@@ -97,5 +97,22 @@ function poller:remove(sock)
return true
end
+-- wait socket events in poller
+function poller:wait(timeout)
+
+ -- wait it
+ local sockevents, count = io.poller_wait(timeout or -1)
+ if count < 0 then
+ return -1, "wait events in poller failed!"
+ end
+
+ -- TODO, wrap socket
+ if sockevents then
+ for i, v in ipairs(sockevents) do
+ end
+ end
+ return count, sockevents
+end
+
-- return module
return poller