diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2001-03-12 19:38:39 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2001-03-12 19:38:39 +0000 |
| commit | 33817f147b37d744846c864f5d59c4ea67a2b930 (patch) | |
| tree | a3a7c1165bb6712e68b2efb0fc49d98dd8dd19f1 | |
| parent | 22396d34f5443eb7f342b25783cbd771d2493ded (diff) | |
| download | luasocket-33817f147b37d744846c864f5d59c4ea67a2b930.tar.gz luasocket-33817f147b37d744846c864f5d59c4ea67a2b930.tar.bz2 luasocket-33817f147b37d744846c864f5d59c4ea67a2b930.zip | |
Set timeout on data socket, to avoid hangs due to no keepalive packets.
| -rw-r--r-- | test/testsrvr.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/testsrvr.lua b/test/testsrvr.lua index 4530014..a11927f 100644 --- a/test/testsrvr.lua +++ b/test/testsrvr.lua | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | ----------------------------------------------------------------------------- | 8 | ----------------------------------------------------------------------------- |
| 9 | -- Read command definitions | 9 | -- Read command definitions |
| 10 | ----------------------------------------------------------------------------- | 10 | ----------------------------------------------------------------------------- |
| 11 | HOST = HOST or "*" | ||
| 11 | assert(dofile("testcmd.lua")) | 12 | assert(dofile("testcmd.lua")) |
| 12 | test_debug_mode() | 13 | test_debug_mode() |
| 13 | 14 | ||
| @@ -33,6 +34,7 @@ function execute_command(cmd, par) | |||
| 33 | if cmd == CONNECT then | 34 | if cmd == CONNECT then |
| 34 | print("server: waiting for data connection...") | 35 | print("server: waiting for data connection...") |
| 35 | data = server:accept() | 36 | data = server:accept() |
| 37 | data:timeout(10) | ||
| 36 | if not data then | 38 | if not data then |
| 37 | fail("server: unable to start data connection!") | 39 | fail("server: unable to start data connection!") |
| 38 | else | 40 | else |
