Kim Alvefur
589010b407
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
0ac9ea3a74
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
2104ac9fb0
net.server: Remove socket constructor fallback
...
Should no longer be needed
7 years ago
Kim Alvefur
8a62a14e5d
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
7a86af343f
net.connect: Fix passing request table to new listener
...
This could be a return value from ondetach
7 years ago
Kim Alvefur
437fd63c6f
net.server: Call a 'onattach' callback when replacing listeners
7 years ago
Kim Alvefur
24ff76428f
net.server: Set default read timeout to 14 minutes ( fixes #971 )
8 years ago
Kim Alvefur
7fa2aa0007
net.server: Add watchfd, a simple API for watching file descriptors
8 years ago
Matthew Wild
4c4988ab3e
net.server_select: Allow setquitting("once") to allow resuming the loop later
8 years ago
Kim Alvefur
3ec060fc0c
Fix spelling throughout the codebase [codespell]
8 years ago
Matthew Wild
a4aeb103dd
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
28ac8f6150
net.server_select: Prevent writes after a handler is closed ( fixes #783 I hope)
9 years ago
Anton Shestakov
6aadf43375
net.server_select: remove unused import [luacheck]
10 years ago
Anton Shestakov
8028f46d24
net.server_select: remove unused one-letter loop variable [luacheck]
10 years ago
Anton Shestakov
7a87176df8
net.server_select: remove unused one-letter loop variables [luacheck]
10 years ago
Kim Alvefur
2ed7876bea
server_select: Add logging of when servers are paused and resumed
10 years ago
Kim Alvefur
c46a125d73
server_select: Pause and mark server as full if accepting a client fails ( fixes #597 )
10 years ago
Kim Alvefur
c2f7450809
server_select: Retry accepting clients from full servers after 10s (matches libevent behaviour)
10 years ago
Kim Alvefur
a1560114d0
server_select: Keep track of which server listeners are full
10 years ago
Kim Alvefur
de6d620539
net.server_select: Add 'server' method to client connections (present in server_event)
10 years ago
Kim Alvefur
6a9bce5dae
server_select: Forward the actual TLS handshake error message
10 years ago
Matthew Wild
e5691fed79
net.server_select: Close all connections when quitting (and not just stepping), matches server_event
10 years ago
Kim Alvefur
7105732151
net.server_{select,event}: Don't rely on LuaSocket and LuaSec being present in the globals table
11 years ago
daurnimator
6d2aec4a34
net.server_select: Remove unused code
11 years ago
daurnimator
9ee1db0a57
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
411cd234e3
net.server_select: Remove do-nothing os_difftime calls [backported from trunk]
11 years ago
daurnimator
7b2112c523
net.server_select: Remove do-nothing os_difftime calls
11 years ago
daurnimator
2a10013752
net.server_select: In add_task timer callback, use passed in time rather than re-fetching
11 years ago
daurnimator
037dd40bb4
net.server_select: Fix timers not being fired until another timer fixes (or 1 second passes)
11 years ago
daurnimator
e51cc17dcb
Move timer code out of util.timer and into relevant net.server backends
11 years ago
Kim Alvefur
edc34e6635
net.server_select: Reset read timeout timer if the event is handled
11 years ago
Matthew Wild
f8776db280
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
69d97b4f7e
net.server_select: 'listener'->'listeners' (fixes undefined global access)
12 years ago
Matthew Wild
257d0f104b
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
57a4449fce
net.server_select/event: Switch sender mode to *a when reading, to make sure we get all available data
12 years ago
daurnimator
b124e4e226
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
cf7efc33b2
net.server_{select,event}: Add compat code for supporting the same client port API on connections
12 years ago
Kim Alvefur
195743afe0
net.server_{select,event}: addclient: Handle missing getaddrinfo
12 years ago
Kim Alvefur
24056ae3ad
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
cf48e76e78
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
ae81ea6eda
net.server_{select,event}: addclient: Add argument for overriding socket type
12 years ago
Kim Alvefur
3e156487cf
net.server_{select,event}: addclient: Add argument for overriding socket type
12 years ago
daurnimator
62ce3bb708
net/server_select: Fix typo
12 years ago
daurnimator
ca6af8e2cf
net/server_select: addclient: Check arguments
12 years ago
daurnimator
32b5b56170
net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure
12 years ago
daurnimator
0d4d70c625
net/server_select: Fix typo
12 years ago
daurnimator
216b5fd851
net/server_select: addclient: Check arguments
12 years ago
daurnimator
e5e8cfdccf
net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure
12 years ago
daurnimator
c8183e6655
net/server_select: Check arguments to add_server correctly
12 years ago
daurnimator
1bdf48e7d2
net/server_select: Check arguments to add_server correctly
12 years ago