> local checker = function()
> checkcount = checkcount+1
> -- will kill the coro after 1 second
> if t+1<socket.gettime() then
> print("timeout")
> error("timeout")
> end
> end
>
Couldn't this be:
local checker = function()
checkcount = checkcount+1
-- will kill the coro after 1 second
if t+1<socket.gettime() then
print("timeout")
coroutine.yield("timeout")
end
end
And then the scheduler decides what to do with a coroutine yielding "timeout". This would only work if "pcall" was changed into a coroutine like this:
Gaspard