mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
Set timeout on data socket, to avoid hangs due to no keepalive packets.
This commit is contained in:
parent
22396d34f5
commit
33817f147b
@ -8,6 +8,7 @@
|
|||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- Read command definitions
|
-- Read command definitions
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
HOST = HOST or "*"
|
||||||
assert(dofile("testcmd.lua"))
|
assert(dofile("testcmd.lua"))
|
||||||
test_debug_mode()
|
test_debug_mode()
|
||||||
|
|
||||||
@ -33,6 +34,7 @@ function execute_command(cmd, par)
|
|||||||
if cmd == CONNECT then
|
if cmd == CONNECT then
|
||||||
print("server: waiting for data connection...")
|
print("server: waiting for data connection...")
|
||||||
data = server:accept()
|
data = server:accept()
|
||||||
|
data:timeout(10)
|
||||||
if not data then
|
if not data then
|
||||||
fail("server: unable to start data connection!")
|
fail("server: unable to start data connection!")
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user