Created
February 9, 2016 23:31
-
-
Save cablehead/1d683a9dd5f895f1542c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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