aboutsummaryrefslogtreecommitdiff
path: root/src/tp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/tp.lua')
-rw-r--r--src/tp.lua22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/tp.lua b/src/tp.lua
index f510226..3e9dba6 100644
--- a/src/tp.lua
+++ b/src/tp.lua
@@ -5,16 +5,18 @@
5-- Conforming to: RFC 2616, LTN7 5-- Conforming to: RFC 2616, LTN7
6-- RCS ID: $Id$ 6-- RCS ID: $Id$
7----------------------------------------------------------------------------- 7-----------------------------------------------------------------------------
8-- make sure LuaSocket is loaded
9require("socket")
10-- get LuaSocket namespace
11local socket = _G[LUASOCKET_LIBNAME]
12 8
13-- create namespace inside LuaSocket namespace 9-----------------------------------------------------------------------------
14socket.tp = socket.tp or {} 10-- Load other required modules
15-- make all module globals fall into namespace 11-----------------------------------------------------------------------------
16setmetatable(socket.tp, { __index = _G }) 12local socket = require("socket")
17setfenv(1, socket.tp) 13
14-----------------------------------------------------------------------------
15-- Setup namespace
16-----------------------------------------------------------------------------
17tp = {}
18setmetatable(tp, { __index = _G })
19setfenv(1, tp)
18 20
19TIMEOUT = 60 21TIMEOUT = 60
20 22
@@ -107,3 +109,5 @@ function connect(host, port)
107 control:settimeout(TIMEOUT) 109 control:settimeout(TIMEOUT)
108 return setmetatable({control = control}, metat) 110 return setmetatable({control = control}, metat)
109end 111end
112
113return tp