# HG changeset patch # User Kim Alvefur # Date 1537014249 -7200 # Node ID 8cc498cb0df77372238ee9fd32aaed3df8a6d3e1 # Parent 7c954c75b6acc0a09bd5ba0b6ecf403bd60c9fad net.server_epoll: Add back setflags API for compat diff -r 7c954c75b6ac -r 8cc498cb0df7 net/server_epoll.lua --- a/net/server_epoll.lua Sat Sep 15 14:20:01 2018 +0200 +++ b/net/server_epoll.lua Sat Sep 15 14:24:09 2018 +0200 @@ -310,6 +310,19 @@ return true; end +function interface:setflags(r, w) + if not(self._wantread or self._wantwrite) then + if not(r or w) then + return true; -- no change + end + return self:add(r, w); + end + if not(r or w) then + return self:del(); + end + return self:set(r, w); +end + -- Called when socket is readable function interface:onreadable() local data, err, partial = self.conn:receive(self.read_size or cfg.read_size);