Comparison

net/server_epoll.lua @ 9319:7c954c75b6ac

net.server_epoll: Fix write signal handling in watchfd API The main loop calls :onwritable but here it was spelled :onwriteable
author Kim Alvefur <zash@zash.se>
date Sat, 15 Sep 2018 14:20:01 +0200
parent 9314:c9eef7e8ee65
child 9320:8cc498cb0df7
comparison
equal deleted inserted replaced
9318:3429006518bf 9319:7c954c75b6ac
600 client:init(); 600 client:init();
601 end 601 end
602 return client, conn; 602 return client, conn;
603 end 603 end
604 604
605 local function watchfd(fd, onreadable, onwriteable) 605 local function watchfd(fd, onreadable, onwritable)
606 local conn = setmetatable({ 606 local conn = setmetatable({
607 conn = fd; 607 conn = fd;
608 onreadable = onreadable; 608 onreadable = onreadable;
609 onwriteable = onwriteable; 609 onwritable = onwritable;
610 close = function (self) 610 close = function (self)
611 self:del(); 611 self:del();
612 end 612 end
613 }, interface_mt); 613 }, interface_mt);
614 if type(fd) == "number" then 614 if type(fd) == "number" then
615 conn.getfd = function () 615 conn.getfd = function ()
616 return fd; 616 return fd;
617 end; 617 end;
618 -- Otherwise it'll need to be something LuaSocket-compatible 618 -- Otherwise it'll need to be something LuaSocket-compatible
619 end 619 end
620 conn:add(onreadable, onwriteable); 620 conn:add(onreadable, onwritable);
621 return conn; 621 return conn;
622 end; 622 end;
623 623
624 -- Dump all data from one connection into another 624 -- Dump all data from one connection into another
625 local function link(from, to) 625 local function link(from, to)