Comparison

net/server_epoll.lua @ 9381:80be543a3785

net.server_epoll: Watching instead of registering, seems more understandable
author Kim Alvefur <zash@zash.se>
date Mon, 24 Sep 2018 19:47:53 +0200
parent 9321:146dc1e4c7ff
child 9382:31a2be28729c
comparison
equal deleted inserted replaced
9380:7425af27fc67 9381:80be543a3785
269 log("error", "Could not register %s: %s", self, err); 269 log("error", "Could not register %s: %s", self, err);
270 return ok, err; 270 return ok, err;
271 end 271 end
272 self._wantread, self._wantwrite = r, w; 272 self._wantread, self._wantwrite = r, w;
273 fds[fd] = self; 273 fds[fd] = self;
274 log("debug", "Registered %s", self); 274 log("debug", "Watching %s", self);
275 return true; 275 return true;
276 end 276 end
277 277
278 function interface:set(r, w) 278 function interface:set(r, w)
279 local fd = self:getfd(); 279 local fd = self:getfd();
304 log("error", "Could not unregister %s: %s", self, err); 304 log("error", "Could not unregister %s: %s", self, err);
305 return ok, err; 305 return ok, err;
306 end 306 end
307 self._wantread, self._wantwrite = nil, nil; 307 self._wantread, self._wantwrite = nil, nil;
308 fds[fd] = nil; 308 fds[fd] = nil;
309 log("debug", "Unregistered %s", self); 309 log("debug", "Unwatched %s", self);
310 return true; 310 return true;
311 end 311 end
312 312
313 function interface:setflags(r, w) 313 function interface:setflags(r, w)
314 if not(self._wantread or self._wantwrite) then 314 if not(self._wantread or self._wantwrite) then