diff options
Diffstat (limited to 'src/tp.lua')
-rw-r--r-- | src/tp.lua | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -46,6 +46,14 @@ end | |||
46 | -- metatable for sock object | 46 | -- metatable for sock object |
47 | local metat = { __index = {} } | 47 | local metat = { __index = {} } |
48 | 48 | ||
49 | function metat.__index:getpeername() | ||
50 | return self.c:getpeername() | ||
51 | end | ||
52 | |||
53 | function metat.__index:getsockname() | ||
54 | return self.c:getpeername() | ||
55 | end | ||
56 | |||
49 | function metat.__index:check(ok) | 57 | function 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) |
124 | end | 132 | end |
125 | 133 | ||
126 | return _M \ No newline at end of file | 134 | return _M |