aboutsummaryrefslogtreecommitdiff
path: root/src/tp.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@impa.br>2016-03-07 01:30:30 -0300
committerDiego Nehab <diego@impa.br>2016-03-07 01:30:30 -0300
commit916b548240b1513410b13f964d80f329aec9c13a (patch)
treedee1cfd05ca7ad72a3db2673fbc7ce005098bb2a /src/tp.lua
parent5b4b9158799293eeaf8439d40a7845b5b0a5e125 (diff)
downloadluasocket-916b548240b1513410b13f964d80f329aec9c13a.tar.gz
luasocket-916b548240b1513410b13f964d80f329aec9c13a.tar.bz2
luasocket-916b548240b1513410b13f964d80f329aec9c13a.zip
Family agostic FTP and expose HTTP/FTP url parsing
Diffstat (limited to 'src/tp.lua')
-rw-r--r--src/tp.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/tp.lua b/src/tp.lua
index 328cbab..b8ebc56 100644
--- a/src/tp.lua
+++ b/src/tp.lua
@@ -46,6 +46,14 @@ end
46-- metatable for sock object 46-- metatable for sock object
47local metat = { __index = {} } 47local metat = { __index = {} }
48 48
49function metat.__index:getpeername()
50 return self.c:getpeername()
51end
52
53function metat.__index:getsockname()
54 return self.c:getpeername()
55end
56
49function metat.__index:check(ok) 57function metat.__index:check(ok)
50 local code, reply = get_reply(self.c) 58 local code, reply = get_reply(self.c)
51 if not code then return nil, reply end 59 if not code then return nil, reply end
@@ -123,4 +131,4 @@ function _M.connect(host, port, timeout, create)
123 return base.setmetatable({c = c}, metat) 131 return base.setmetatable({c = c}, metat)
124end 132end
125 133
126return _M \ No newline at end of file 134return _M