Comparison

doc/net.server.lua @ 11120:b2331f3dfeea

Merge 0.11->trunk
author Matthew Wild <mwild1@gmail.com>
date Wed, 30 Sep 2020 09:50:33 +0100
parent 9846:9a0da809ed4a
comparison
equal deleted inserted replaced
11119:68df52bf08d5 11120:b2331f3dfeea
157 - handle 157 - handle
158 - nil, "an error message": on failure (e.g. out of file descriptors) 158 - nil, "an error message": on failure (e.g. out of file descriptors)
159 ]] 159 ]]
160 local function addserver(address, port, listeners, pattern, sslctx) 160 local function addserver(address, port, listeners, pattern, sslctx)
161 end 161 end
162
163 --[[ Binds and listens on the given address and port
164 Mostly the same as addserver but with all optional arguments in a table
165
166 Arguments:
167 - address: address to bind to, may be "*" to bind all addresses. will be resolved if it is a string.
168 - port: port to bind (as number)
169 - listeners: a table of listeners
170 - config: table of extra settings
171 - read_size: the amount of bytes to read or a read pattern
172 - tls_ctx: is a valid luasec constructor
173 - tls_direct: boolean true for direct TLS, false (or nil) for starttls
174
175 Returns:
176 - handle
177 - nil, "an error message": on failure (e.g. out of file descriptors)
178 ]]
179 local function listen(address, port, listeners, config)
180 end
181
162 182
163 --[[ Wraps a lua-socket socket client socket in a handle. 183 --[[ Wraps a lua-socket socket client socket in a handle.
164 The socket must be already connected to the remote end. 184 The socket must be already connected to the remote end.
165 If `sslctx` is given, a SSL session will be negotiated before listeners are called. 185 If `sslctx` is given, a SSL session will be negotiated before listeners are called.
166 186
253 wrapclient = wrapclient; 273 wrapclient = wrapclient;
254 addclient = addclient; 274 addclient = addclient;
255 closeall = closeall; 275 closeall = closeall;
256 hook_signal = hook_signal; 276 hook_signal = hook_signal;
257 watchfd = watchfd; 277 watchfd = watchfd;
278 listen = listen;
258 } 279 }