Kim Alvefur
72decbc631
net.server_select: Fix IP validation to use correct variable (thanks quest)
...
Copy-paste mistake most likely. Not caught because server_select is ignored by luacheck.
7 years ago
Kim Alvefur
75784460bb
net.server: Swich method for connecting sockets with remotes
...
LuaSocket TCP sockets have have both :connect and :setpeername, which
are the exact same function, however UDP sockets only have :setpeername.
Switching to :setpeername allows most of this code to be generic wrt
TCP/UDP.
7 years ago
Kim Alvefur
59be9d9f5e
net.server: Remove socket constructor fallback
...
Should no longer be needed
7 years ago
Kim Alvefur
d1c5754d3c
net.server: Require IP address as argument to addclient (no DNS names)
...
The net.connect API should be used to resolve DNS names first
7 years ago
Kim Alvefur
177fab2322
net.connect: Fix passing request table to new listener
...
This could be a return value from ondetach
7 years ago
Kim Alvefur
074af5e0b1
net.server: Call a 'onattach' callback when replacing listeners
7 years ago
Kim Alvefur
031dc2e2a0
net.server: Add an API for holding writes of outgoing data
7 years ago
Kim Alvefur
e1846ef9a3
net.server_select: Still allow buffering outgoing data on write-locked connections
7 years ago
Kim Alvefur
e21ccabfac
net.server_select: Replace use of deprecated :lock_read in server.link
7 years ago
Kim Alvefur
193eebddaf
net.server_select: Deprecate :lock method
...
Exists only in server_select and I found nothing using it
7 years ago
Kim Alvefur
d67b08d9c4
server_select: Fix :lock method
...
This always unlocks reading.
I don't believe this is used anywhere. server_event does not implement this.
7 years ago
Kim Alvefur
b593a8c54f
net.server_select: Move code from :lock_read into :pause and :resume
7 years ago
Kim Alvefur
3391b3c890
net.server_select: Deprecate connection:lock_read() method
7 years ago
Kim Alvefur
e77ed7aa89
net.server: Set default read timeout to 14 minutes ( fixes #971 )
8 years ago
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)
12 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