Skip to content

Instantly share code, notes, and snippets.

@cablehead
Created February 9, 2016 23:31
Show Gist options
  • Save cablehead/1d683a9dd5f895f1542c to your computer and use it in GitHub Desktop.
Save cablehead/1d683a9dd5f895f1542c to your computer and use it in GitHub Desktop.
local levee = require("levee")
local _ = levee._
local function main(h)
while true do
local err, n = h.thread:call(
function()
local _ = require("levee._")
local err, no = _.connect("127.0.0.1", 8007)
if err then return nil, err.code end
return nil, no
end):recv()
if n < 0 then
print(n)
else
C.close(n)
end
end
end
local h = levee.Hub()
main(h)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment