view util/xpcall.lua @ 10852:2e48aebdb915

net.server_select: Pass conn/handler to readbuffer/sendbuffer The internal implementations don't use it, but this causes onreadable and onwritable of watchfd to receive the conn as they do in other backends.
author Matthew Wild <mwild1@gmail.com>
date Mon, 01 Jun 2020 13:41:41 +0100
parents cfc7b2f7251e
children d10957394a3c
line wrap: on
line source

local xpcall = xpcall;

if select(2, xpcall(function (x) return x end, function () end,  "test")) ~= "test" then
	xpcall = require"util.compat".xpcall;
end

return {
	xpcall = xpcall;
};