diff options
Diffstat (limited to 'src/tp.lua')
-rw-r--r-- | src/tp.lua | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -109,8 +109,8 @@ function metat.__index:close() | |||
109 | end | 109 | end |
110 | 110 | ||
111 | -- connect with server and return c object | 111 | -- connect with server and return c object |
112 | function connect(host, port, create, timeout) | 112 | function connect(host, port, timeout, create) |
113 | local c, e = (create or socket.tcp()) | 113 | local c, e = (create or socket.tcp)() |
114 | if not c then return nil, e end | 114 | if not c then return nil, e end |
115 | c:settimeout(timeout or TIMEOUT) | 115 | c:settimeout(timeout or TIMEOUT) |
116 | local r, e = c:connect(host, port) | 116 | local r, e = c:connect(host, port) |