aboutsummaryrefslogtreecommitdiff
path: root/src/tp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/tp.lua')
-rw-r--r--src/tp.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tp.lua b/src/tp.lua
index b671e58..f510226 100644
--- a/src/tp.lua
+++ b/src/tp.lua
@@ -6,10 +6,10 @@
6-- RCS ID: $Id$ 6-- RCS ID: $Id$
7----------------------------------------------------------------------------- 7-----------------------------------------------------------------------------
8-- make sure LuaSocket is loaded 8-- make sure LuaSocket is loaded
9if not LUASOCKET_LIBNAME then error('module requires LuaSocket') end 9require("socket")
10-- get LuaSocket namespace 10-- get LuaSocket namespace
11local socket = _G[LUASOCKET_LIBNAME] 11local socket = _G[LUASOCKET_LIBNAME]
12if not socket then error('module requires LuaSocket') end 12
13-- create namespace inside LuaSocket namespace 13-- create namespace inside LuaSocket namespace
14socket.tp = socket.tp or {} 14socket.tp = socket.tp or {}
15-- make all module globals fall into namespace 15-- make all module globals fall into namespace
@@ -35,6 +35,7 @@ local function get_reply(control)
35 -- reply ends with same code 35 -- reply ends with same code
36 until code == current and sep == " " 36 until code == current and sep == " "
37 end 37 end
38print(reply)
38 return code, reply 39 return code, reply
39end 40end
40 41
@@ -58,6 +59,7 @@ function metat.__index:check(ok)
58end 59end
59 60
60function metat.__index:command(cmd, arg) 61function metat.__index:command(cmd, arg)
62print(cmd, arg)
61 if arg then return self.control:send(cmd .. " " .. arg.. "\r\n") 63 if arg then return self.control:send(cmd .. " " .. arg.. "\r\n")
62 else return self.control:send(cmd .. "\r\n") end 64 else return self.control:send(cmd .. "\r\n") end
63end 65end