aboutsummaryrefslogtreecommitdiff
path: root/src/tp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/tp.lua')
-rw-r--r--src/tp.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tp.lua b/src/tp.lua
index 3912fab..9365255 100644
--- a/src/tp.lua
+++ b/src/tp.lua
@@ -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
88end 88end
@@ -95,7 +95,7 @@ end
95-- connect with server and return sock object 95-- connect with server and return sock object
96function connect(host, port) 96function 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)
101end 101end