aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-02 23:47:52 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-02 23:47:52 +0000
commit471334c3d07f398e4b0859c43276341a28b91504 (patch)
treeff1894b013b093280b0878d16f1c827da85a3ea9 /etc
parentc3e0063b430beba5d7e6911c8f59fd37b8017e61 (diff)
downloadluasocket-471334c3d07f398e4b0859c43276341a28b91504.tar.gz
luasocket-471334c3d07f398e4b0859c43276341a28b91504.tar.bz2
luasocket-471334c3d07f398e4b0859c43276341a28b91504.zip
Fixed stupid bugs.
Diffstat (limited to 'etc')
-rw-r--r--etc/lp.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/lp.lua b/etc/lp.lua
index e112ab4..3c36b11 100644
--- a/etc/lp.lua
+++ b/etc/lp.lua
@@ -26,10 +26,11 @@ local function connect(localhost, option)
26 if option.localbind then 26 if option.localbind then
27 -- bind to a local port (if we can) 27 -- bind to a local port (if we can)
28 local localport = 721 28 local localport = 721
29 local done, err
29 repeat 30 repeat
30 skt = test(socket.tcp()) 31 skt = test(socket.tcp())
31 try(skt:settimeout(30)) 32 try(skt:settimeout(30))
32 local done, err = skt:bind(localhost, localport) 33 done, err = skt:bind(localhost, localport)
33 if not done then 34 if not done then
34 localport = localport + 1 35 localport = localport + 1
35 skt:close() 36 skt:close()
@@ -38,6 +39,7 @@ local function connect(localhost, option)
38 until localport > 731 39 until localport > 731
39 test(skt, err) 40 test(skt, err)
40 else skt = test(socket.tcp()) end 41 else skt = test(socket.tcp()) end
42print("'" .. host .. "'")
41 try(skt:connect(host, port)) 43 try(skt:connect(host, port))
42 return { skt = skt, try = try } 44 return { skt = skt, try = try }
43end 45end