From a247edeac984c22ac4419eb03b5bbbdcd9a2206f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 9 May 2018 16:15:40 +0200 Subject: net.server: Add watchfd, a simple API for watching file descriptors --- doc/net.server.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc') diff --git a/doc/net.server.lua b/doc/net.server.lua index bd207fd5..f07a2bd0 100644 --- a/doc/net.server.lua +++ b/doc/net.server.lua @@ -229,6 +229,18 @@ Arguments: local function hook_signal(signal_id, handler) end +--[[ Adds a low-level FD watcher +Arguments: +- fd_number: A non-negative integer representing a file descriptor or + object with a :getfd() method returning one +- on_readable: Optional callback for when the FD is readable +- on_writable: Optional callback for when the FD is writable + +Returns: +- net.server handle +]] +local function watchfd(fd_number, on_readable, on_writable) +end return { get_backend = get_backend; @@ -240,4 +252,5 @@ return { addclient = addclient; closeall = closeall; hook_signal = hook_signal; + watchfd = watchfd; } -- cgit v1.2.3