# HG changeset patch # User Kim Alvefur # Date 1552237508 -3600 # Node ID 9a0da809ed4a4b372dd314b1d51306c13f56e23e # Parent 774b2ce62318249c6ded418fc572de9fcaa5c48d doc/net.server: Document the new server.listen() API diff -r 774b2ce62318 -r 9a0da809ed4a doc/net.server.lua --- a/doc/net.server.lua Mon Mar 04 13:46:09 2019 +0100 +++ b/doc/net.server.lua Sun Mar 10 18:05:08 2019 +0100 @@ -160,6 +160,26 @@ local function addserver(address, port, listeners, pattern, sslctx) end +--[[ Binds and listens on the given address and port +Mostly the same as addserver but with all optional arguments in a table + +Arguments: + - address: address to bind to, may be "*" to bind all addresses. will be resolved if it is a string. + - port: port to bind (as number) + - listeners: a table of listeners + - config: table of extra settings + - read_size: the amount of bytes to read or a read pattern + - tls_ctx: is a valid luasec constructor + - tls_direct: boolean true for direct TLS, false (or nil) for starttls + +Returns: + - handle + - nil, "an error message": on failure (e.g. out of file descriptors) +]] +local function listen(address, port, listeners, config) +end + + --[[ Wraps a lua-socket socket client socket in a handle. The socket must be already connected to the remote end. If `sslctx` is given, a SSL session will be negotiated before listeners are called. @@ -255,4 +275,5 @@ closeall = closeall; hook_signal = hook_signal; watchfd = watchfd; + listen = listen; }