diff options
author | Kim Alvefur <zash@zash.se> | 2018-05-09 16:15:40 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-05-09 16:15:40 +0200 |
commit | 7fa2aa0007e5bdae55ff0ced57ba193154302312 (patch) | |
tree | ea76a040fa49fccc3bc0669effd781d0382c34cd /doc/net.server.lua | |
parent | 814f998b90f4b214f7b89f3d8d1d0032f9a2e78a (diff) | |
download | prosody-7fa2aa0007e5bdae55ff0ced57ba193154302312.tar.gz prosody-7fa2aa0007e5bdae55ff0ced57ba193154302312.zip |
net.server: Add watchfd, a simple API for watching file descriptors
Diffstat (limited to 'doc/net.server.lua')
-rw-r--r-- | doc/net.server.lua | 13 |
1 files changed, 13 insertions, 0 deletions
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; } |