Diff

net/server_epoll.lua @ 7795:03081bd5c5bb

net.server_epoll: Add the 'once' argument to loop for parity with server_select
author Kim Alvefur <zash@zash.se>
date Sun, 01 Jan 2017 19:32:54 +0100
parent 7794:424bbbeb9257
child 7796:12609aee3b3b
line wrap: on
line diff
--- a/net/server_epoll.lua	Sun Jan 01 19:30:38 2017 +0100
+++ b/net/server_epoll.lua	Sun Jan 01 19:32:54 2017 +0100
@@ -617,7 +617,7 @@
 end
 
 -- Main loop
-local function loop()
+local function loop(once)
 	repeat
 		local t = runtimers(cfg.max_wait, cfg.min_wait);
 		local fd, r, w = epoll.wait(t);
@@ -637,7 +637,7 @@
 		elseif r ~= "timeout" then
 			log("debug", "epoll_wait error: %s", tostring(r));
 		end
-	until quitting;
+	until once or quitting;
 	return quitting;
 end