Skip to content

Commit

Permalink
Added ability to remove server after adding.
Browse files Browse the repository at this point in the history
  • Loading branch information
pkulchenko committed Mar 18, 2014
1 parent d2474ab commit ee77f93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/copas/copas.lua
Expand Up @@ -444,6 +444,13 @@ function copas.addserver(server, handler, timeout)
addTCPserver(server, handler, timeout)
end
end

function copas.removeserver(server)
_servers[server] = nil
_reading:remove(server)
return server:close()
end

-------------------------------------------------------------------------------
-- Adds an new courotine thread to Copas dispatcher
-------------------------------------------------------------------------------
Expand Down

0 comments on commit ee77f93

Please sign in to comment.