diff options
Diffstat (limited to 'src/tp.lua')
| -rw-r--r-- | src/tp.lua | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -82,7 +82,7 @@ function metatable.__index:source(src, instr) | |||
| 82 | while true do | 82 | while true do |
| 83 | local chunk, err = src() | 83 | local chunk, err = src() |
| 84 | if not chunk then return not err, err end | 84 | if not chunk then return not err, err end |
| 85 | local ret, err = try_sending(self.sock, chunk) | 85 | local ret, err = self.sock:send(chunk) |
| 86 | if not ret then return nil, err end | 86 | if not ret then return nil, err end |
| 87 | end | 87 | end |
| 88 | end | 88 | end |
| @@ -95,7 +95,7 @@ end | |||
| 95 | -- connect with server and return sock object | 95 | -- connect with server and return sock object |
| 96 | function connect(host, port) | 96 | function connect(host, port) |
| 97 | local sock, err = socket.connect(host, port) | 97 | local sock, err = socket.connect(host, port) |
| 98 | if not sock then return nil, message end | 98 | if not sock then return nil, err end |
| 99 | sock:settimeout(TIMEOUT) | 99 | sock:settimeout(TIMEOUT) |
| 100 | return setmetatable({sock = sock}, metatable) | 100 | return setmetatable({sock = sock}, metatable) |
| 101 | end | 101 | end |
