Kim Alvefur
a247edeac9
net.server: Add watchfd, a simple API for watching file descriptors
8 years ago
Matthew Wild
e1ba498527
net.server_select: Allow setquitting("once") to allow resuming the loop later
8 years ago
Kim Alvefur
b1235c60a7
Fix spelling throughout the codebase [codespell]
8 years ago
Matthew Wild
17f7c8bc3a
net.server_select: Better detection of errors for outgoing connections
...
On connection failure, a socket is marked readable and writable. So
to detect initial connection failures (connection refused, etc.) we
now watch for sockets becoming readable during initial connection,
and also read from readable sockets before writing to writable
sockets.
This should fix 'onconnect' being called for outgoing connections
that actually failed.
8 years ago
Kim Alvefur
f91ba70e32
net.server_select: Prevent writes after a handler is closed ( fixes #783 I hope)
9 years ago
Anton Shestakov
4653e9d8ab
net.server_select: remove unused import [luacheck]
10 years ago
Anton Shestakov
7d5a4cde28
net.server_select: remove unused one-letter loop variable [luacheck]
10 years ago
Anton Shestakov
d77dfdad8e
net.server_select: remove unused one-letter loop variables [luacheck]
10 years ago
Kim Alvefur
48feb105c4
server_select: Add logging of when servers are paused and resumed
10 years ago
Kim Alvefur
1b285192b2
server_select: Pause and mark server as full if accepting a client fails ( fixes #597 )
10 years ago
Kim Alvefur
773269db7c
server_select: Retry accepting clients from full servers after 10s (matches libevent behaviour)
10 years ago
Kim Alvefur
f4631dda05
server_select: Keep track of which server listeners are full
10 years ago
Kim Alvefur
d2bf6120f1
net.server_select: Add 'server' method to client connections (present in server_event)
10 years ago
Kim Alvefur
34556c6963
server_select: Forward the actual TLS handshake error message
10 years ago
Matthew Wild
1eb8d252ea
net.server_select: Close all connections when quitting (and not just stepping), matches server_event
10 years ago
Kim Alvefur
0a257b3921
net.server_{select,event}: Don't rely on LuaSocket and LuaSec being present in the globals table
11 years ago
daurnimator
6591bd9db5
net.server_select: Remove unused code
11 years ago
daurnimator
8843844d0a
net.server_select: Remove socket.sleep call from main loop
...
It's been there since the start; but should really not be required.
People can remember an issue with FreeBSD that this solved, but this was a hack solution anyway.
If that issue rears it's head again, we will solve it properly.
11 years ago
daurnimator
a358cc2e16
net.server_select: Remove do-nothing os_difftime calls [backported from trunk]
11 years ago
daurnimator
ea84b7e278
net.server_select: Remove do-nothing os_difftime calls
11 years ago
daurnimator
c6bc543f5e
net.server_select: In add_task timer callback, use passed in time rather than re-fetching
11 years ago
daurnimator
7a1a86aba7
net.server_select: Fix timers not being fired until another timer fixes (or 1 second passes)
11 years ago
daurnimator
dcd855afaa
Move timer code out of util.timer and into relevant net.server backends
11 years ago
Kim Alvefur
89344e5323
net.server_select: Reset read timeout timer if the event is handled
11 years ago
Matthew Wild
2967393ae8
net.server_select: When an SSL handshake is connected, if there is pending data to be written to the socket, mark the socket as waiting to send (thanks daurnimator)
11 years ago
Matthew Wild
3d6dafb89a
net.server_select: 'listener'->'listeners' (fixes undefined global access)
11 years ago
Matthew Wild
972f29756d
net.server_{select,event}: Add 'ondetach' callback for listener objects, to notify them when another listener is being assigned to a connection
12 years ago
Matthew Wild
5647cd2287
net.server_select/event: Switch sender mode to *a when reading, to make sure we get all available data
12 years ago
daurnimator
55a097981e
net/server_*: Fix addclient: LuaSocket 3.0-rc1 sometimes returns EALREADY instead of EINPROGRESS when the dns lookup has multiple results
12 years ago
Kim Alvefur
8cf56e87ac
net.server_{select,event}: Add compat code for supporting the same client port API on connections
12 years ago
Kim Alvefur
29d3c27219
net.server_{select,event}: addclient: Handle missing getaddrinfo
12 years ago
Kim Alvefur
d5879e2187
net.server_{select,event}: addclient: Use getaddrinfo to detect IP address type if no socket type argument given. (Argument must be given for non-TCP)
12 years ago
Kim Alvefur
bcb9af93c2
net.server_{select,event}: addclient: Use getaddrinfo to detect IP address type if no socket type argument given. (Argument must be given for non-TCP)
12 years ago
Kim Alvefur
58bb5f01fd
net.server_{select,event}: addclient: Add argument for overriding socket type
12 years ago
Kim Alvefur
24118d8f74
net.server_{select,event}: addclient: Add argument for overriding socket type
12 years ago
daurnimator
31e5378e58
net/server_select: Fix typo
12 years ago
daurnimator
e3c0bdb6f3
net/server_select: addclient: Check arguments
12 years ago
daurnimator
98bd53004d
net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure
12 years ago
daurnimator
3cec6c49ed
net/server_select: Fix typo
12 years ago
daurnimator
f73d6a6eeb
net/server_select: addclient: Check arguments
12 years ago
daurnimator
94fa96bf88
net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure
12 years ago
daurnimator
6044700335
net/server_select: Check arguments to add_server correctly
12 years ago
daurnimator
927d791737
net/server_select: Check arguments to add_server correctly
12 years ago
daurnimator
34e978cc07
net/server_select: pcall require ssl (easy to forget to require ssl)
12 years ago
Matthew Wild
ceba28fe83
net.server_select: Don't remove the socket from sendlist when we might have data in the buffer (we'll now let sendbuffer() take care of that) (thanks daurnimator)
12 years ago
Matthew Wild
d3d91c224a
server_select: fix onreadtimeout support so that listeners can override the default (disconnect) behaviour
12 years ago
Kim Alvefur
3606c59339
net.server_select: Return handler from addclient
13 years ago
Kim Alvefur
f99f4528d9
net.server_select: Pass on all arguments to addclient on to wrapclient
13 years ago
Florian Zeitz
4b618a8727
Remove all trailing whitespace
13 years ago
Kim Alvefur
d7d15e2ec7
net.server_select: Make sure there is a server to pause when hitting maxfd (Thanks elghinn)
13 years ago