aboutsummaryrefslogtreecommitdiff
path: root/src/tp.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-04 15:15:45 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-06-04 15:15:45 +0000
commit9ed7f955e5fc69af9bf1794fa2c8cd227981ba24 (patch)
tree8c3521366ef84f534bbec278437be7ea24e2ac1c /src/tp.lua
parent63d60223da9de60f873ca08a25dbd9512c998929 (diff)
downloadluasocket-9ed7f955e5fc69af9bf1794fa2c8cd227981ba24.tar.gz
luasocket-9ed7f955e5fc69af9bf1794fa2c8cd227981ba24.tar.bz2
luasocket-9ed7f955e5fc69af9bf1794fa2c8cd227981ba24.zip
Só pra não perder se der merda.
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