Few extra changes.
This commit is contained in:
parent
bce1cb30d8
commit
7195ab620b
7 changed files with 11 additions and 16 deletions
|
@ -106,7 +106,10 @@ function open(server, port)
|
|||
local tp = socket.try(tp.connect(server or SERVER, port or PORT, TIMEOUT))
|
||||
local s = setmetatable({tp = tp}, metat)
|
||||
-- make sure tp is closed if we get an exception
|
||||
s.try = socket.newtry(function() s:close() end)
|
||||
s.try = socket.newtry(function()
|
||||
if s.tp:command("QUIT") then s.tp:check("2..") end
|
||||
s:close()
|
||||
end)
|
||||
return s
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue